Looping the 2068

Author(s): Murray Barasch; Caroline Barasch
Publication: LISTing Newsletter
Date: November 1992
Pages: 4

Here’s our program to draw (on the 2068) an ellipse with center at X,Y; semi-major axis (half width) A; semi-minor axis (half height) B; rotated from the horizontal by angle R (radians, not degrees).

10 INPUT "INPUT X,Y,A,B,R"'X'Y'A'B'R
20 FOR T=0 TO 2*PI STEP .05
30 PLOT X+A*COS T*COS R-B*SIN T*SIN R,Y+A*COS T*SIN R+B*SIN T*COS R
40 NEXT T

This was based on parametric equations for the ellipse, modified by rotation through angle R and translated to a new center.

Editor’s Note

The INPUT statement on the 2068 is almost as flexible as the PRINT. With multiple entries in a single INPUT, you’ll have to press ENTER after each variable. To convert to the 1000, just put in seperate INPUT statements, and remember to keep the numbers smaller.

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