[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Two-Liners; Coils
Here's two variations on the same theme. The two-liners given below
repeatedly draw, then erase, a 3-D coil on the HiRes2 screen. The first
draws the coil as a family of circles representing cross-sections of the
coil itself. The second draws the coil as a continuous sprial, so it's a
coil of a coil *B^). Using a similar approach it's a simple matter to make
a torous instead of a coil by setting the pitch of the coil to zero.
Actually, the evolution of the coil program was from a circle, to a
sphere, to a torous, and then the coil. Sooo.... my next 'Fun With
Circles' two-liners will be a torous routine. Kinda working backwards, but
why not *B^)
0 REM 'COIL' A TWO-LINER BY JOHN L. GRAHAM. CONTROL-C TO STOP.
1 A = 8 * ATN (1):B = 36:C = A / B:D = 2:E = 60:F = D * E:G = D * A /
F:H = 30:I = 190 - 2 * H:J = I / F:K = 100:L = 140:M = 0: HGR2
2 M = M + 1:N = (M - 2 * INT (M / 2)) * 3: HCOLOR= N: FOR O = 0 TO F:
P = O * G:Q = H * COS (P):R = L - K * COS (P):S = H + O * J:
FOR T = 0 TO A STEP C:U = R + Q * COS (T):V = S + H * SIN (T):
HPLOT U,V: NEXT : NEXT : GOTO 2
0 REM 'COILED COIL' A TWO-LINER BY JOHN L. GRAHAM. CONTROL-C TO STOP.
1 A = 8 * ATN (1):B = 35:C = A / B:D = 2:E = 2400:F = D * E:G = D * A /
F:H = 30:I = 190 - 2 * H:J = I / F:K = 100:L = 140:M = 0: HGR2
2 M = M + 1:N = (M - 2 * INT (M / 2)) * 3: HCOLOR= N: FOR O = 0 TO F:
P = O * G:Q = O * C:R = H * COS (P):S = L - K * COS (P):T = H + O *
J:U = S + R * COS (Q):V = T + H * SIN (Q): HPLOT U,V: NEXT : GOTO 2
Have fun!
John