|
!'Nested Polygon
SET WINDOW -1,1,-1,1
LET N=5
DIM X(N),Y(N),XX(N),YY(N)
FOR I=0 TO 359 STEP 360/N
LET K=K+1
LET X(K)=SIN(RAD(I))
LET Y(K)=COS(RAD(I))
PLOT LINES:X(K),Y(K);
NEXT I
PLOT LINES:X(1),Y(1)
!'LET C=0
!'SET AREA COLOR C
!'MAT PLOT AREA:X,Y
LET A=9
LET B=1
DO
FOR I=1 TO N
LET XX(I)=(A*X(I)+B*X(MOD(I,N)+1))/(A+B)
LET YY(I)=(A*Y(I)+B*Y(MOD(I,N)+1))/(A+B)
PLOT LINES:XX(I),YY(I);
NEXT I
PLOT LINES:XX(1),YY(1)
!'LET C=MOD(C+1,2)
!'SET AREA COLOR C
!'MAT PLOT AREA:XX,YY
MAT X=XX
MAT Y=YY
LOOP UNTIL SQR((X(2)-X(1))^2+(Y(2)-Y(1))^2)<.03
END
|
|