LOGO-L> Pythagorean tree 
Author Message
 LOGO-L> Pythagorean tree

Apropos the 'fractal' thread: here's a nice pair of programs: they
produce rather broccoli-like results, if you start them onscreen in the
right places.

TO PYTHAGORAS :LENGTH :LIMIT :ANGLE
IF :LENGTH < :LIMIT [REPEAT 4 [FD :LENGTH RT 90] STOP]
(LOCAL "LSIDE "RSIDE)
MAKE "LSIDE :LENGTH * COS :ANGLE
MAKE "RSIDE :LENGTH * SIN :ANGLE
FD :LENGTH LT :ANGLE
PYTHAGORAS :LSIDE :LIMIT :ANGLE
RT 90 FD :LSIDE
PYTHAGORAS :RSIDE :LIMIT :ANGLE
RT 90 FD :RSIDE
LT 90 - :ANGLE BK :LENGTH
REPEAT 3 [FD :LENGTH RT 90]
END

TO PYTHAGORAS1 :LENGTH :LIMIT :ANGLE
IF :LENGTH < :LIMIT [REPEAT 4 [FD :LENGTH RT 90] STOP]
(LOCAL "LSIDE "RSIDE)
MAKE "LSIDE :LENGTH * COS :ANGLE
MAKE "RSIDE :LENGTH * SIN :ANGLE
FD :LENGTH LT :ANGLE
PYTHAGORAS1 :LSIDE :LIMIT 90 - :ANGLE
RT 90 FD :LSIDE
PYTHAGORAS1 :RSIDE :LIMIT 90 - :ANGLE
RT 90 FD :RSIDE
LT 90 - :ANGLE BK :LENGTH
REPEAT 3 [FD :LENGTH RT 90]
END

I found that PYTHAGORAS(1) 100 4 30 gave good results on my machine.

Tony
--
 _________            Tony Pay

    |   |ay           Oxford OX2 6RE
                      tel/fax 01865 553339

---------------------------------------------------------------





Thu, 25 May 2000 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. >>>>>AVL tree

2. LOGO-L> Chrismas Tree

3. LOGO-L> Re: Half a Christmas Tree

4. LOGO-L> tumtum trees

5. LOGO-L> improved musical tree

6. LOGO-L> Music Tree

7. Alternate solution to tree -> tree problem

8. LOGO-L> Apple logo/MSW Logo

9. LOGO-L> Reseach Machines Logo (RM LOGO)

10. WTD: 'ls -lR '->HTML code

11. VA 4.5 >> Container Details Tree

12. LOGO-L> Welcome to logo-l

 

 
Powered by phpBB® Forum Software