stairs Art/Electric
L-SYSTEMS
back to programs
 
koch snowflakes
general von koch
hilbert curve
pythagorean tree
H-H dragon curve
peano-gosper 19
'H' branching curve
plant
sierpinski square
sierpinski arrow
gosper square
sierpinski curve
spirograph circle
sierpinski carpet
sierpinski gasket
peano-gosper 13
peano-gosper 7
peano curve
penrose tiling
snowflake halls
peano octagon
peano hexagon
levy curve
sierpinski pentagon
not sierpinski
peano curve - H
square knot
sierpinski square 2
koch pentagram
fass curve
square cross
cesaro triangle
realistic snowflake
gray code dragon
sierpinski gasket 3
sierpinski sieve
koch square curve
dekking island
koch island
koch ff curve
hexagon spacefill
 
e-mail
PYTHAGOREAN TREE
pythagorean tree

PROGRAM pythagorean_tree4A !TRUE BASIC version April 2004
SET MODE "color"
SET WINDOW 0,1199,0,903
CALL init
END

SUB init
PRINT "input: size try 160,order try 12"
INPUT size,order
CLEAR
LET x=1200
LET y=100
LET x1=(x-size)/2
LET x2=(x+size)/2
LET y1,y2 = y
CALL drawTree(x1,y1,x2,y2,order)
END SUB

SUB drawTree(x1,y1,x2,y2,order)
LET x3= x1+y1-y2
LET y3= y1-x1+x2
LET x4= x2-y2+y1
LET y4= y2-x1+x2
LET x5= (x3+x4+y3-y4)/2
LET y5= (y3+y4+x4-x3)/2
SET COLOR 2
PLOT x1,y1;x2,y2;x4,y4;x3,y3;x1,y1
SET COLOR 13
PLOT x3,y3;x5,y5;x4,y4;x3,y3
IF order > 0 THEN
CALL drawTree(x3,y3,x5,y5,order-1)
CALL drawTree(x5,y5,x4,y4,order-1)
END IF
END SUB



Website, Text and Some Images Copyright © 2002 tzingaro.com, all rights reserved.