' this is a simple rotation program
' it is meant only to illustrate the use of mathematics to produce
'   fluid rotation
' code by Scott W Gates








0   C = 2: I = 0
1   SP = 2: CH = 128: X1 = 1: Y1 = 1
2   CLS
3   SCREEN 1
5   REM
6   DEF FNR (A) = A * 3.14 / 180
7   XO = 150: YO = 70
8   R = 50
9   SA = 0
10   SA = FNR(SA)
11   EA = 360
12   EA = FNR(EA)
13   AI = 5
14   AI = FNR(EA)
15   PX = 140 + R: PY = 80
16   REM TH=SA
17   TH = TH + AI: IF TH > EA THEN TH = SA
18   X = R * COS(TH) * 3
19   Y = R * SIN(TH)
20   PX = XO + X
21   PY = YO + Y
22   QX = XO - X
23   QY = YO - Y
24   XX = R * COS(TH - 8) * 3
25   YY = R * SIN(TH - 8)
26   RX = XO + XX
27   RY = YO + YY
28   SX = XO - XX
29   SY = YO - YY
30   LINE (PX, PY)-(XO, YO), C: LINE -(QX, QY), C: LINE -(QX, QY + 20), C: LINE -(PX, PY + 20), C: LINE -(PX, PY), C
31   LINE (RX, RY)-(XO, YO), C: LINE -(SX, SY), C: LINE -(SX, SY + 20), C: LINE -(RX, RY + 20), C: LINE -(RX, RY), C
32   LINE (PX, PY)-(RX, RY), C: LINE (PX, PY + 20)-(RX, RY + 20), C: LINE (PX, PY)-(SX, SY), C: LINE (PX, PY + 20)-(SX, SY + 20), C
33 REM TOP DRAWS BOTTOM ERASES
34   LINE (P1, P2)-(X1, Y1), I: LINE -(Q1, Q2), I: LINE -(Q1, Q2 + 20), I: LINE -(P1, P2 + 20), I: LINE -(P1, P2), I
35   LINE (R1, R2)-(X1, Y1), I: LINE -(S1, S2), I: LINE -(S1, S2 + 20), I: LINE -(R1, R2 + 20), I: LINE -(R1, R2), I
36   LINE (P1, P2)-(R1, R2), I: LINE (P1, P2 + 20)-(R1, R2 + 20), I: LINE (P1, P2)-(S1, S2), I: LINE (P1, P2 + 20)-(S1, S2 + 20), I
37   P1 = PX: P2 = PY: Q1 = QX: Q2 = QY: X1 = XO: Y1 = YO
38   S1 = SX: S2 = SY: R1 = RX: R2 = RY


39 KE$ = INKEY$: IF KE$ = "" THEN 17
   IF KE$ = "+" THEN R = R + 1
   IF KE$ = "-" THEN R = R - 1


40  REM START 1





200 GOTO 10




  



   





