MAT READ px
DATA 0.20, 0.40, 0.60, 0.80, 0.70, 0.60, 0.50, 0.40, 0.30, 0.20, 0.40, 0.60
MAT READ py
DATA 0.11, 0.11, 0.11, 0.11, 0.29, 0.47, 0.65, 0.47, 0.29, 0.11, 0.11, 0.11
SET WINDOW -1/4,1/4, -1/4,1/4
!----------
LET N=3
DO
LET s=MOD(s,36)+1
LET s2=INT((s-1)/4)+1
SET DRAW mode hidden
CLEAR
DRAW D4(N) WITH SHIFT(-0.5,-0.5/SQR(3))*ROTATE(PI*2/36*s+PI)
SET DRAW mode explicit
WAIT DELAY 0.2
LOOP
!------
PICTURE D4(k)
IF 0< k THEN
DRAW D4(k-1) WITH SCALE(1/2,1/2)*SHIFT(1/4,SQR(3)/4) ! 上
DRAW D4(k-1) WITH SCALE(1/2,-1/2)*SHIFT(1/4,SQR(3)/4) ! 中
DRAW D4(k-1) WITH SCALE(1/2,1/2)*ROTATE(-PI*2/3)*SHIFT(1/4,SQR(3)/4) ! 左
DRAW D4(k-1) WITH SCALE(1/2,1/2)*ROTATE(PI*2/3)*SHIFT(1,0) ! 右
ELSE
DRAW Set01
END IF
END PICTURE
!------ 種の三角図
PICTURE Set01
PLOT LINES: 0,0; 1,0 ;0.5,SQR(3)/2 ;0,0
SET AREA COLOR 5 !2
DRAW disk WITH SCALE(0.1)*SHIFT(px(s2),py(s2)) ! 飾り1
SET AREA COLOR 6 !3
DRAW disk WITH SCALE(0.1)*SHIFT(px(s2+1),py(s2+1)) ! 飾り2
SET AREA COLOR 7 !4
DRAW disk WITH SCALE(0.1)*SHIFT(px(s2+2),py(s2+2)) ! 飾り3
SET AREA COLOR 1
DRAW disk WITH SCALE(0.1)*SHIFT(px(s2+3),py(s2+3)) ! 飾り4
END PICTURE
!万華鏡
投稿者:SECOND 投稿日:2008年11月23日(日)16時05分47秒OPTION ARITHMETIC NATIVE
DIM px(12),py(12)
MAT READ px
DATA 0.20, 0.40, 0.60, 0.80, 0.70, 0.60, 0.50, 0.40, 0.30, 0.20, 0.40, 0.60
MAT READ py
DATA 0.11, 0.11, 0.11, 0.11, 0.29, 0.47, 0.65, 0.47, 0.29, 0.11, 0.11, 0.11
SET WINDOW -1/4,1/4, -1/4,1/4
!----------
LET N=3
DO
LET s=MOD(s,36)+1
LET s2=INT((s-1)/4)+1
SET DRAW mode hidden
CLEAR
DRAW D4(N) WITH SHIFT(-0.5,-0.5/SQR(3))*ROTATE(PI*2/36*s+PI)
SET DRAW mode explicit
WAIT DELAY 0.2
LOOP
!------
PICTURE D4(k)
IF 0< k THEN
DRAW D4(k-1) WITH SCALE(1/2,1/2)*SHIFT(1/4,SQR(3)/4) ! 上
DRAW D4(k-1) WITH SCALE(1/2,-1/2)*SHIFT(1/4,SQR(3)/4) ! 中
DRAW D4(k-1) WITH SCALE(1/2,1/2)*ROTATE(-PI*2/3)*SHIFT(1/4,SQR(3)/4) ! 左
DRAW D4(k-1) WITH SCALE(1/2,1/2)*ROTATE(PI*2/3)*SHIFT(1,0) ! 右
ELSE
DRAW Set01
END IF
END PICTURE
!------ 種の三角図
PICTURE Set01
PLOT LINES: 0,0; 1,0 ;0.5,SQR(3)/2 ;0,0
SET AREA COLOR 5 !2
DRAW disk WITH SCALE(0.1)*SHIFT(px(s2),py(s2)) ! 飾り1
SET AREA COLOR 6 !3
DRAW disk WITH SCALE(0.1)*SHIFT(px(s2+1),py(s2+1)) ! 飾り2
SET AREA COLOR 7 !4
DRAW disk WITH SCALE(0.1)*SHIFT(px(s2+2),py(s2+2)) ! 飾り3
SET AREA COLOR 1
DRAW disk WITH SCALE(0.1)*SHIFT(px(s2+3),py(s2+3)) ! 飾り4
END PICTURE
END