2
canvas := DrGeoSketch new fullscreen.
4
koch := [ :a :b :k | |ab c d v |
6
ab := (canvas segment: a to: b) hide.
7
c := (canvas pointOnLine: ab at: 1 / 3) hide.
8
d := (canvas pointOnLine: ab at: 2 / 3) hide.
10
altIntersectionOf: (canvas perpendicularBisector: ab) hide
11
and: (canvas circleCenter: c to: d) hide) hide.
12
koch value: a value: c value: k - 1.
13
koch value: c value: v value: k - 1.
14
koch value: v value: d value: k - 1.
15
koch value: d value: b value: k - 1].
16
canvas segment: a to: b].
18
value: ((canvas point: -8@3) name: 'A')
19
value: ((canvas point: 8@3) name: 'B')