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
koch f curve
hexagon spacefill
 
e-mail
KOCH QUADRIC FF SPACEFILL CURVE L-SYSTEM
lsys Koch Curve FF
comparison mouseover with koch f quadric curve

PROGRAM LSYS_KOCH_CURVE_FF   ! © W.van Duyn 16th May 2004
OPTION ANGLE degrees
SET WINDOW 0,1199,0,903
SET background color "white"
SET color "black"
PRINT "location: x try 600,y try 450"
INPUT x,y
PRINT"Number of iterations try 4 or 5, size try 100,angle try 4"
INPUT depth,size,ak
CLEAR
SET COLOR "black"
BOX AREA 0,1199,0,903
FLOOD 1,1
LET k=360/ak
LET r=2
LET d=size/r^depth
LET a=0
SET COLOR 14
CALL lsys1(depth,d,a,k,x,y)
CALL turnRIGHT(a,k)
CALL turnRIGHT(a,k)
FOR i=1 to 4
SET color i+9
CALL lsys1(depth,d,a,k,x,y)
CALL turnRIGHT(a,k)
NEXT i
END

SUB lsys1(depth,d,a,k,x,y)
IF depth=0 THEN
CALL moveON(d,x,y,a)
EXIT IF
ELSE
CALL lsys2(depth-1,d,a,k,x,y)
CALL lsys1(depth-1,d,a,k,x,y)
CALL turnRIGHT(a,k)
CALL lsys1(depth-1,d,a,k,x,y)
CALL turnRIGHT(a,k)
CALL lsys2(depth-1,d,a,k,x,y)
CALL turnLEFT(a,k)
CALL lsys1(depth-1,d,a,k,x,y)
CALL turnLEFT(a,k)
END IF
END SUB

SUB lsys2(depth,d,a,k,x,y)
IF depth=0 THEN
CALL moveON(d,x,y,a)
EXIT IF
ELSE
CALL turnRIGHT(a,k)
CALL lsys2(depth-1,d,a,k,x,y)
CALL turnRIGHT(a,k)
CALL lsys1(depth-1,d,a,k,x,y)
CALL turnLEFT(a,k)
CALL lsys2(depth-1,d,a,k,x,y)
CALL turnLEFT(a,k)
CALL lsys2(depth-1,d,a,k,x,y)
CALL lsys1(depth-1,d,a,k,x,y)
END IF
END SUB

SUB moveON(d,x,y,a)
OPTION ANGLE degrees
LET dx=d*cos(a)
LET dy=d*sin(a)
PLOT x,y;x+dx,y+dy
LET x=x+dx
LET y=y+dy
END SUB

SUB turnRIGHT(a,k)
LET a=a-k
END SUB

SUB turnLEFT(a,k)
LET a=a+k
END SUB


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