Compucolor.org – Virtual Media

Listing of file='RECTAN.BAS;01' on disk='vmedia/demos-sector.ccvf'

5 REM   ROTATE AND DIMINISH RECTANGLE
10 PI= 3.141539
20 M= 64
30 N= 64
40 C= 1
50 PLOT 12,27,24
170 L= 45
180 FOR T= 0TO 500STEP 20
190 T0= T* PI/ 180
200 V1= L* (COS (T0)- SIN (T0))
210 V2= L* (SIN (T0)+ COS (T0))
220 P1= INT (M+ V1):P2= INT (N+ V2)
230 Q1= INT (M- V1):Q2= INT (N- V2)
240 V3= - L* (COS (T0)+ SIN (T0))
250 V4= - L* (SIN (T0)- COS (T0))
260 R1= INT (M+ V3):R2= INT (N+ V4)
270 S1= INT (M- V3):S2= INT (N- V4)
280 X= P1:Y= P2:GOSUB 9100
290 X= R1:Y= R2:GOSUB 9000
300 X= Q1:Y= Q2:GOSUB 9000
310 X= S1:Y= S2:GOSUB 9000
320 X= P1:Y= P2:GOSUB 9000
330 L= L/ (SQR (2)* SIN (PI/ 4+ PI/ 180))
400 PLOT 6,C:C= C+ 1
430 IF C= 8THEN C= 1
500 NEXT T
1000 PLOT 3,31,15:PRINT "+":PLOT 8:END
8900 REM   PLOTTING SUBROUTINES
9000 PLOT 2,242,X,Y,255:RETURN
9100 PLOT 2,X,Y,255:RETURN
9200 PLOT 2,242,X,Y,255:RETURN
9300 PLOT 2,X,Y,255:RETURN
9400 PRINT X$:RETURN
9700 PLOT 2,0,0,255
9999 END