|
REM BARNSLEY FERN(バーンスレイのシダ)
LET LEFT = -4
LET RIGHT = 4
LET BOTTOM = 0
LET TOP = 11
SET WINDOW LEFT, RIGHT, BOTTOM, TOP
SET POINT STYLE 1
SET POINT COLOR 3 ! 緑
SET AREA COLOR 1 ! 背景黒
PLOT AREA : LEFT,BOTTOM;RIGHT,BOTTOM;RIGHT,TOP;LEFT,TOP
LET N = 100000
LET X = 0
LET Y = 0
RANDOMIZE
FOR I = 1 TO N
DRAW FERN(X,Y,RND)
NEXT I
PICTURE FERN(X,Y,R)
IF R < 0.85 THEN
LET PX = X
LET X = 0.85 * PX + 0.04 * Y
LET Y = -0.04 * PX + 0.85 * Y + 1.6
ELSEIF R < 0.92 THEN
LET PX = X
LET X = 0.2 * PX - 0.26 * Y
LET Y = 0.23 * PX + 0.22 * Y + 1.6
ELSEIF R < 0.99 THEN
LET PX = X
LET X = -0.15 * PX + 0.28 * Y
LET Y = 0.26 * PX + 0.24 * Y + 0.44
ELSE
LET X = 0
LET Y = 0.16 * Y
END IF
PLOT POINTS : X,Y
END PICTURE
END
|
|