Ellipse Algo
Ellipse Algo
Ellipse Algo
Our approach here is similar to that used in displaying a raster circle. Given
parameters rx,ry and (xc,yc), we determine points (x,y) for an ellipse in standard
position centered on the origin, and then we shift the points so the ellipse is
centred at (xc,yc). If we wish also to display the ellipse in nonstandard position,
we could then rotate the ellipse about its centre coordinates to reorient the major
and minor axes. For the present, we consider only the display of ellipses in
standard position.
The midpoint ellipse method is applied throughout the first quadrant in two parts.
Fig 1:43 shows the division of the first quadrant according to the slope of an
ellipse with rx<ry. We process this quadrant by taking unit steps in the x direction
where the slope of the curve has a magnitude less than 1, and taking unit steps in
they direction where the slop has a magnitude greater than 1.
2r2yxk+1=2r2yxk +2r2y 2r2xyk+1=2r2xyk -2r2x
and continue until 2r2yx≥2r2x y.
p10=r2y-r2xry+(1/4)r2x= -332
Successive decision parameter values and positions along the ellipse path
are calculated using the midpoint method as
The remaining positions along the ellipse path in the first quadrant are then
calculated as