Andrey Hihlovskiy
Professional blog on groovy, gradle, Java, Javascript and other stuff.
Tag Archives: turtle graphics
How to teach your kids to draw fractals
February 10, 2014
Posted by on It’s probably one of the best things that computer-geek dad/mom can teach their kid – to draw fractals with LOGO. Here is how you do it:
- Install Kturtle or similar LOGO software
- Refresh your knowledge on fractals (for example, at the excellent website of Jeffrey Ventrella)
- Look at the examples of turtle graphics and fractals on the Internet
- Repeat (together with your kid) very basic stuff from geometry: how to add/subtract angles, triangle postulate, etc.
Then fun begins:
- 30 minutes exercise implementing Koch Curve
- 1 hour exercise implementing Sierpinsky Triangle
- 1.5 hour exercise implementing various fractal trees
- 1 hour implementing Dragon Curve
- etc. etc.
Some very important things to remember:
- don’t overload your kid with knowledge. It’s important to get to exercises ASAP, otherwise motivation is lost.
- at first do every exercise yourself, without the kid. This way you make sure that you understand the goals and methods of implementation and can deliver that understanding to a kid.
- be clear at formulating goals and algorithms, show on paper how stuff works.
- don’t try to be overly supportive, give a kid space to think and experiment with implementation.
- ask kid questions and stimulate thinking: “what about changing this parameter here, how will it affect our fractal”?
- don’t try to do all exercises at once – this would not be effective, since the brain needs time to digest new concepts.
This could be the beginning of your kids’ big love – love to mathematics and science.
Illustration: Sierpinsky Triangle, created by my daughter with Kturtle:
The source code:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
learn triangle $x { | |
fw $x | |
tr 120 | |
fw $x | |
tr 120 | |
fw $x | |
tr 120 | |
} | |
learn serpinsky $x, $level { | |
triangle $x | |
pu | |
fw $x/2 | |
tr 60 | |
pd | |
serpinsky1 $x/2, $level | |
} | |
learn serpinsky1 $x, $level { | |
if $level == 0 { | |
return | |
} | |
triangle $x | |
pu | |
tl 60 | |
fw $x/2 | |
tr 60 | |
pd | |
serpinsky1 $x/2, $level – 1 | |
pu | |
tr 60 | |
fw $x | |
tl 60 | |
pd | |
serpinsky1 $x/2, $level – 1 | |
pu | |
tr 180 | |
fw $x | |
tl 180 | |
pd | |
serpinsky1 $x/2, $level – 1 | |
pu | |
tl 60 | |
fw $x/2 | |
tr 60 | |
pd | |
} | |
$level = 7 | |
reset | |
go 120, 0 | |
print "Serpinsky carpet level " + $level | |
pu | |
go 0, 400 | |
pd | |
dir 30 | |
serpinsky 400, $level |
Recent Comments