1
# examples derived from
2
# Visual Modeling with Logo: A Structural Approach to Seeing
6
# Turtle Geometry: The Computer as a Medium for Exploring Mathematics
7
# by Harold Abelson and Andrea diSessa
9
# see http://physics.hallym.ac.kr/education/chaos/ncsa/Fgeom.html
10
# for some more explanation of fractals
12
from wxTurtleCurves import turtleCurves
14
class turtleWrapper(turtleCurves):
17
def drawMain(dc_local, w, turtleWrapper=turtleWrapper):
18
t = turtleWrapper(dc_local)
27
t.fractalgon(3, 200, 4, -1)
28
t.fractalgon(3, 250, 4, 1)
30
# if you turn on the odometer you should see the total distance
31
# the turle has gone, so you can compare a level 1 curve to
33
# but you will need to subtract the radius (rad) distance * 2
34
# to compensate for the forward() and back() calls in fractalgon
35
# the same distance measurements can be done with other curves:
36
# cCurves, dragon, hilbert, or any drawing commands
37
# for example as the number of sides increases in a polygon
38
# the distance traveled will approach the 2 * pi * r (the radius)
39
# (circumference) of the circle bounded by the polygon