<<>> <> <> <> <> <<>> DIRECTORY Vector2 USING [VEC], ImagerTransformation USING [Transformation]; ImagerPen: CEDAR DEFINITIONS ~ BEGIN VEC: TYPE ~ Vector2.VEC; Transformation: TYPE ~ ImagerTransformation.Transformation; Pen: TYPE ~ REF PenRep; <> <<-bounds.x <= s[i].x <= bounds.x>> <<-bounds.y <= s[i].y <= bounds.y>> PenRep: TYPE ~ RECORD [ bounds: VEC, majorAxis, minorAxis: REAL, theta: Degrees, s: SEQUENCE size: NAT OF VEC ]; <<>> Degrees: TYPE ~ REAL; MakeTransformedCircle: PROC [strokeWidth: REAL, m: Transformation, thickening: VEC ¬ [0.0, 0.0]] RETURNS [Pen]; <> <<>> MakeEllipse: PROC [majorAxis, minorAxis: REAL, theta: Degrees] RETURNS [Pen]; <> <> <<$(x/a)^2+(y/b)^2=1$, where |a=major_axis/2| and |b=minor_axis/2|. In general, the points of the ellipse are generated in the complex plane by the formula $e^{i\theta}(a\cos t+ib\sin t)$, as $t$~ranges over all angles. Notice that if |major_axis=minor_axis=d|, we obtain a circle of diameter~|d|, regardless of the value of |theta|. >> <<>> END. <> <> <> <>