|
REM パスカルのリマソン
DEF F(X,Y,A) = (X^2 + Y^2 - X)^2 - A^2 * (X^2 + Y^2)
LET LEFT = -1.5
LET RIGHT = 3.5
LET BOTTOM = -2.5
LET TOP = 2.5
SET WINDOW LEFT, RIGHT, BOTTOM, TOP
SET AREA COLOR 1 ! 背景黒
PLOT AREA : LEFT,BOTTOM;RIGHT,BOTTOM;RIGHT,TOP;LEFT,TOP
SET POINT STYLE 1
LET COL1 = 4 ! 赤
LET COL2 = 0 ! 白
FOR A = 2.2 TO 0.4 STEP -0.2
SET POINT COLOR COL1
FOR I = 0 TO PIXELX(RIGHT)
LET X = WORLDX(I)
FOR J = 0 TO PIXELY(TOP)
LET Y = WORLDY(J)
IF F(X,Y,A) < 0 THEN
PLOT POINTS: X, Y
END IF
NEXT J
NEXT I
SWAP COL1,COL2 ! 赤白交互
NEXT A
DRAW GRID
END
|
|