Line Draw

Developer(s): Patrick Fagan
Date: 1985
Type: Program
Platform(s): TS 2068
Tags: Graphics

Two line-drawing routines for the TS2068. The first joins every point on an ellipse to every other, five times over, with a random 8 to 13 points and the width and height you give each time. The second draws nested, rotated polygons from the number of sides and copies, the size and the rotation you give, three times over.

RUN starts the first routine. GO TO 1650 starts the second. Rotation is in radians. Lines 1678 and 1685 read B for the rotation, as in the printed listing.

Published in LISTing May – June 1985 (Line Draw).

Related Articles

Handwritten beside line 1685: “- ALSO – LET q=q+8”

Image Gallery

Source Code

1230 REM DRAWN LINES FROM POINT ON CIRCUMFERENCE TO OTHER POINTS ON CIRCUMFERENCE
1235 LET C=0
1240 DIM X(20): DIM Y(20)
1245 LET C=C+1
1250 LET N=INT (RND*6)+8
1255 LET P=2*PI/N
1257 INPUT "DISTANCE X''DISTANCE Y FROM CENTER CO-ORD";E;" ";F
1260 FOR I=1 TO N
1265 LET Z=P*I
1270 LET X(I)=INT (COS Z*E+127)
1275 LET Y(I)=INT (SIN Z*F+85)
1280 NEXT I
1285 FOR I=1 TO N
1290 PLOT X(I),Y(I)
1295 NEXT I
1297 INK 9
1300 FOR w=n TO 1 STEP -1
1305 FOR i=1 TO n
1310   PLOT x(w),y(w)
1315 DRAW INT x(i)-x(w),INT y(i)-y(w)
1320 NEXT i: NEXT w
1325 IF C=5 THEN STOP
1330 GO TO 1240
1650 REM DRAW MULTI SIDED FIGURES
1655 LET A=0
1660 DIM x(30): DIM y(30)
1665 INPUT "# OF POLYGON SIDES ";SD
1670 INPUT "# OF POLYGONS?";SI
1675 LET tp=2*PI: LET g=0: LET SP=tp/sd: LET q=127: LET r=87
1677 INPUT "DISTANCE X''DISTANCE Y FROM CENTER CO-ORD";E;" ";F
1678 INPUT "AMOUNT OF ROTATION? ";B
1680 FOR t=0 TO SI-1
1685 LET g=B
1695 FOR n=1 TO sd
1700 LET z=sp*n+g
1705 LET x(n)=INT (SIN z*E+q)
1710 LET y(n)= INT (COS z*F+r)
1715 NEXT n
1720 LET n=sd-1
1725 FOR s=sd TO 1 STEP -1
1730 PLOT x(n),y(n): DRAW x(s)-x(n),y(s)-y(n)
1735 LET n=n-1
1740 IF n=0 THEN LET n=sd
1745 NEXT s: LET q=q-3: LET r=r-3: NEXT t: LET A=A+1
1755 IF A=3 THEN STOP
1760 GO TO 1660

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.