Swirl

 投稿者:しばっち  投稿日:2015年10月28日(水)22時26分53秒
 
!'Swirl
CALL GINIT(601,601)
SET WINDOW -300,300,300,-300
FOR N=1 TO 6
   CLEAR
   FOR Y=-300 TO 300
      FOR X=-300 TO 300
         IF X=0 AND Y=0 THEN LET T=0 ELSE LET T=ANGLE(X,Y)
         LET R=SQR(X*X+Y*Y)
         LET C=SIN(6*COS(RAD(R))-N*T)
         CALL PSET(X,Y,128+C*128,128+C*128,128+C*128)
      NEXT X
   NEXT Y
   WAIT DELAY 1
NEXT N
END

EXTERNAL SUB GINIT(XSIZE,YSIZE)
SET BITMAP SIZE XSIZE,YSIZE
SET COLOR MIX(0) 0,0,0
SET COLOR MODE "NATIVE"
CLEAR
SET POINT STYLE 1
SET WINDOW 0,XSIZE-1,YSIZE-1,0
END SUB

EXTERNAL SUB PSET(X,Y,R,G,B)
LET RR=MIN(255,MAX(0,INT(R)))
LET GG=MIN(255,MAX(0,INT(G)))
LET BB=MIN(255,MAX(0,INT(B)))
SET COLOR COLORINDEX(RR/255,GG/255,BB/255)
PLOT POINTS:X,Y
END SUB
 

戻る