Removed shapes, fixes #69
This commit is contained in:
33
examples/demo/dejong.lisp
Normal file
33
examples/demo/dejong.lisp
Normal file
@@ -0,0 +1,33 @@
|
||||
; dejong attractor
|
||||
|
||||
(clear)
|
||||
(defn point (x y color)
|
||||
(fill (rect x y 1 1) color))
|
||||
|
||||
(defn _dejong (x y a b c d)
|
||||
(rest ((point
|
||||
(add 300 (mul 100 x))
|
||||
(add 400 (mul 100 y))
|
||||
"red")
|
||||
(add (sin (mul a y)) (mul x (cos (mul b x))))
|
||||
(add (mul x (sin (mul x c))) (cos (mul d y)))
|
||||
))
|
||||
)
|
||||
|
||||
(defn dejong (r a b c d)
|
||||
(reduce
|
||||
(λ (acc val)
|
||||
(first (
|
||||
(_dejong (first acc) (last acc) a b c d)
|
||||
)))
|
||||
(range 0 r)
|
||||
(2 1)
|
||||
)
|
||||
)
|
||||
(benchmark
|
||||
'(dejong 12800
|
||||
(random -2 2)
|
||||
(random -2 2)
|
||||
(random -2 2)
|
||||
(random -2 2)
|
||||
))
|
||||
30
examples/demo/spiral.lisp
Normal file
30
examples/demo/spiral.lisp
Normal file
@@ -0,0 +1,30 @@
|
||||
; animated recusive spiral
|
||||
; by @local_guru
|
||||
|
||||
(clear)
|
||||
(defn rec
|
||||
(v)
|
||||
(if
|
||||
(gt v 0)
|
||||
(
|
||||
(stroke
|
||||
(circle
|
||||
(add 375
|
||||
(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(114,222, 194,0.1)")
|
||||
(rec
|
||||
(sub v 0.3)))))
|
||||
; set false to stop
|
||||
(animate true)
|
||||
(rec 300)
|
||||
Reference in New Issue
Block a user