Changed the line syntax to (line x1 y1 x2 y2)

This commit is contained in:
Devine Lu Linvega
2019-07-24 20:29:03 +09:00
parent 33574979cd
commit 1c7b74d582
13 changed files with 71 additions and 140 deletions

View File

@@ -1,25 +1,24 @@
(resetTransform)
(clear)
(defn branch
(v)
(if
(gt v 0)
(defn branch
(v)
(if
(gt v 0)
(
(scale 0.95)
(stroke
(line (pos 0 0) (pos 100 100))
10 "white")
(move 100 100)
(pushTransform)
(rotate (div v 50))
(branch (sub v 1))
(popTransform)
(pushTransform)
(rotate (div v -50))
(branch (sub v 1))
(popTransform)
)
)
)
(scale 0.95)
(stroke
(line 0 0 100 100) 2 "white")
(move 100 100)
(pushTransform)
(rotate
(div v 50))
(branch
(sub v 1))
(popTransform)
(pushTransform)
(rotate
(div v -50))
(branch
(sub v 1))
(popTransform)) ))
(branch 10)

View File

@@ -13,7 +13,7 @@
))
;
(defn when-animate () (
(stroke (line prev-pos mouse-pos) 4 "#72dec2")
(stroke (line (of prev-pos :x) (of prev-pos :y) (of mouse-pos :x) (of mouse-pos :y)) 4 "#72dec2")
(move w h)
(rotate 0.002)
(scale 0.998)

View File

@@ -5,9 +5,8 @@
(cx cy r a)
(
(stroke
(line
(pos cx cy)
(circle-pos cx cy r a)) 2 "white")))
(line cx cy (of (circle-pos cx cy r a) :x) (of (circle-pos cx cy r a) :y)
) 2 "white")))
;
(defn draw-star
(cx cy r c)