Spherical Code

 投稿者:しばっち  投稿日:2015年10月28日(水)22時26分20秒
 
!'Spherical Code
CALL GINIT(600,600)
LET RR=150
LET X=300
LET Y=300
LET M=9
CALL CIRCLE(X,Y,RR,7)
LET T=360/M
LET R=1/(CSC(RAD(T/2))-1)*RR
FOR TH=0 TO 360 STEP T
   CALL CIRCLE(X+(RR+R)*COS(RAD(TH)),Y-(RR+R)*SIN(RAD(TH)),R,7)
NEXT TH
END

EXTERNAL SUB GINIT(XSIZE,YSIZE)
SET BITMAP SIZE XSIZE,YSIZE
SET WINDOW 0,XSIZE-1,YSIZE-1,0
SET POINT STYLE 1
SET COLOR MODE "REGULAR"
SET COLOR MIX(0) 0,0,0
SET COLOR MIX(1) 0,0,1
SET COLOR MIX(2) 1,0,0
SET COLOR MIX(3) 1,0,1
SET COLOR MIX(4) 0,1,0
SET COLOR MIX(5) 0,1,1
SET COLOR MIX(6) 1,1,0
SET COLOR MIX(7) 1,1,1
CLEAR
END SUB

EXTERNAL SUB CIRCLE(X,Y,R,C)
SET COLOR C
DRAW CIRCLE WITH SCALE(R)*SHIFT(X,Y)
END SUB
 

戻る