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
KOCH QUADRIC ISLAND CURVE L-SYSTEM
lsys Koch Quadric Island curve
koch quadric island

PROGRAM Koch_Quadric_Island   ! © W.van Duyn 15th May 2004
! after Mandelbrot - the Fractal Geometry of Nature - p 50
SET MODE "color"
SET WINDOW 0,1199,0,903
SET BACKGROUND COLOR "white"
CLEAR
CALL init
END

SUB init
OPTION ANGLE degrees
PRINT "input: x try 400, y try 640"
INPUT x,y
PRINT "input: Side try 400,level try 3, dimension try 4"
INPUT side,level,ak
CLEAR
SET COLOR "black"
BOX AREA 0,1199,0,903
FLOOD 1,1
SET COLOR "white"
LET a=0
LET k=360/ak
LET r=2+2*(1+COS(k))
LET d=side/(r^level)
FOR i = 1 TO ak
SET COLOR i+9
CALL shift(level,d,x,y,a,ak,k)
NEXT i
END SUB

SUB axiom(level,d,x,y,a,ak,k)
LET lev=level
CALL move(d,lev,a,x,y,k,ak)
CALL turnRIGHT(a,k)
END SUB

SUB move(d,lev,a,x,y,k,ak)
IF lev=0 THEN
CALL travelON(d,a,x,y)
EXIT IF
ELSE
CALL move(d,lev-1,a,x,y,k,ak)
CALL turnLEFT(a,k)
FOR p=1 TO 2
CALL move(d,lev-1,a,x,y,k,ak)
CALL turnRIGHT(a,k)
NEXT p
CALL move(d,lev-1,a,x,y,k,ak)
CALL move(d,lev-1,a,x,y,k,ak)
FOR q=1 TO 2
CALL turnLEFT(a,k)
CALL move(d,lev-1,a,x,y,k,ak)
NEXT q
CALL turnRIGHT(a,k)
CALL move(d,lev-1,a,x,y,k,ak)
END IF
END SUB

SUB travelON(d,a,x,y)
OPTION ANGLE degrees
LET x2=x+d*cos(a)
LET y2=y+d*sin(a)
PLOT x,y;x2,y2
LET x=x2
LET y=y2
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.