[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Two-liner; Torous
Whew! I hate time change. I thought I'd finish this one before stepping
outside to watch Mir fly overhead then go to bed. Anywho, this little
two-liner repeatedly draws, then erases, a torous which passes in/out of
the plane of the screen. The most significant difference between this and
the coil code is a sine term which enlarges the diameter of the torous in
the y direction as it passes out of the plane of the screen, and shrinks
it as it passes into the screen. This gives a since of perspective and
reduces the number of points that plot on top of each other. To further
reduce the problem of points on top of each other and odd-ball number was
used for number of points per circle (33) and circles per revolution (57).
0 REM 'TOROUS' A TWO-LINER BY JOHN L. GRAHAM. CONTROL-C TO STOP.
1 A = 8 * ATN (1):B = 33:C = A / B:D = 1:E = 57:F = D * E:G = D * A /
F:H = 30:I = 10:J = 190 - 2 * H:K = J / F:L = 100:M = 140:N = 0:O = 96:
HGR2
2 N = N + 1:P = (N - 2 * INT (N / 2)) * 3: HCOLOR= P: FOR Q = 0 TO F:
R = Q * G:S = COS (R):T = H * S:U = M - L * S:V = H + I * SIN (R):
FOR W = 0 TO A STEP C:X = U + T * COS (W):Y = O + V * SIN (W): HPLOT
X,Y: NEXT : NEXT : GOTO 2
Have fun!
John