1
|canvas shape alfa fibo a b m s|
2
canvas _ DrGeoSketch new.
3
alfa _ (canvas freeValue: -90 degreesToRadians) hide.
4
shape _ [:c :o :f| | e p |
5
e _ (canvas rotate: o center: c angle: alfa) hide.
6
(canvas arcCenter: c from: e to: o) large.
7
p _ canvas translate: e vector: (canvas vector: c to: o) hide.
8
(canvas polygon: { c. o. p hide. e }) name: f; unfilled; small.
11
fibo _ [ :f :o :c :k | | e f1 f2 f3 c2|
12
"f1: term Fn-1, f2: term Fn, o & c: origin and center of spiral arm
13
e: extremity of the spiral arm"
17
e _ shape value: c value: o value: f3.
18
c2 _ (canvas scale: c center: e factor: f3 / f2) hide.
19
k > 0 ifTrue: [ fibo value: {f2. f3} value: e value: c2 value: k - 1 ]].
21
a _ canvas point: 1@0.
22
b _ canvas point: -1 @0.
23
m _ (canvas middleOf: a and: b) hide.
24
s _ shape value: m value: a value: 1.
25
shape value: m value: s value: 1.
26
fibo value: {1. 2} value: b value: a value: 10