Redoing the animation example

This commit is contained in:
Devine Lu Linvega
2019-07-21 20:12:10 +09:00
parent 70fa2b420f
commit bb887ae6c3
5 changed files with 51 additions and 34 deletions

View File

@@ -17,4 +17,18 @@
(if
(gt v 1)
(times
(sub v 1) f))))
(sub v 1) f))))
; convert deg to radians
(defn deg-rad
(deg)
(mul deg
(div PI 180)))
; position on a circle from angle
(defn circle-pos
(cx cy r a) {:x
(add cx
(mul r
(cos a))) :y
(add cy
(mul r
(sin a)))})