Rotated Ellipse

Date: 1992
Type: Program
Platform(s): TS 2068

A four-line program that plots an ellipse of any size and rotation from its parametric equations.

RUN it and enter five values, pressing ENTER after each: the centre X and Y, the half width A, the half height B, and the rotation R in radians (128, 88, 80, 40, 0.5 is a good first try). The whole ellipse has to fit on the 256 by 176 screen. Drawing takes under two minutes.

Published in LISTing November 1992 (Looping the 2068).

Related Articles

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).

Image Gallery

Source Code

  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

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