Geometry exploration
This collection of shapes is the result of my learning the LOGO programming language.
Sierpinski triangles interpretation
I wanted to create recursive or fractal patterns similar to the ferns already created, or other natural elements using mathematical formulae, eg. sunflowers using the Fibonacci sequence. So first I tried creating the Sierpinksi triangles - triangles within triangles, each one a quarter the size of the next largest.
PD REPEAT 3 [FD 10 LT 120] FD 5 LT 60 REPEAT 3 [FD 5 LT 120] FD 2.5 LT 60 REPEAT 3 [FD 2.5 LT 120] FD 1.25 LT 60 REPEAT 3 [FD 1.25 LT 120] FD .625 LT 60 REPEAT 3 [FD .625 LT 120] FD .3125 LT 60 REPEAT 3 [FD .325 LT 120] PU WEST 20
This didn't really use any of LOGO's recursive ability, so I tried understanding how to make the code more condensed.
Defining new objects & metapatterns
The circle-like shape made of 36 repeated squares shows my understanding of how to define new objects in LOGO to use as shortcuts when creating an object which recurs.
PD TO square REPEAT 4 [FD 10 LT 90] END REPEAT 36[square RT 10] PU SOUTH 20
TO tree :size IF :size < 2 [STOP] FD :size LT 30 tree :size * (7/10) RT 60 tree :size * (7/10) LT 30 tree :size * (7/10) RU 30 tree :size * (7/10) RD 60 tree :size * (7/10) RU 30 BK :size END RU 90 PD tree 10 PU
- Luke Messenger's blog
- Login or register to post comments
- 14155 reads
Comments
problems
Having some trouble inserting and viewing the world: I'm hitting 'insert X3D world' after publishing and it doesn't come up with a preview.
Reproduced with no problem....
I have taken your codes and reproduced the results with no problem. I have also published the x3d file (with viewpoint, background and navigation info checked) as Test.x3d into your folder so it is now loaded in your blog.
This could be a bug related to the inclusion of viewpoint, background and navigation info. I will need to investigate further.
Thanks for sharing the geometrical world you created. The 3D recursive tree is very cool.
Thanks
Oh brilliant! Thanks Andy.
Formatting Logo programs
BTW, would you be able to format your Logo program to be syntax highlighted?
In this video http://www.youtube.com/watch?v=2eTATwBhsc0 at around 8:40 it shows you how to format Logo program in blog.
I also noticed your code about:
In the workshop I played for 100 repeat but why do you put 36 repeat?
repeating
Originally I repeated 360 times with a one degree rotation just to create a circle, but changed it to 36 with a 10 degree rotation for computational simplicity.