Ported spiral

This commit is contained in:
Devine Lu Linvega 2019-07-20 16:16:33 +09:00
parent 0f29e94ee3
commit 82080c35fd
2 changed files with 30 additions and 29 deletions

View File

@ -1,29 +0,0 @@
; animated recusive spiral
; by @local_guru
(
(def start (get ronin "animate"))
(clear)
(defn rec
(v)
(if (gt v 0)
((stroke
(circle
(add 300
(mul (cos (add (div v 17) (div (time) 2000)))
(div v 2)
)
)
(add 300
(mul (sin (div v 11))
(div v 2)
)
)
(div v 2))
1 "rgba(255,255,255,0.1")
(rec (sub v 0.3))
)
)
)
(start)
(rec 300)
)

30
examples/spiral.lisp Normal file
View File

@ -0,0 +1,30 @@
; animated recusive spiral
; by @local_guru
(
(clear)
(defn rec
(v)
(if
(gt v 0)
(
(stroke
(circle
(add 300
(mul
(cos
(add
(div v 17)
(div
(time) 2000)))
(div v 2)))
(add 300
(mul
(sin
(div v 11))
(div v 2)))
(div v 2)) 1 "#fff")
(rec
(sub v 0.3)))))
; set false to stop
(animate true)
(rec 300))