Lec 8 - Scan Converting An Ellipse
Lec 8 - Scan Converting An Ellipse
j
Drawback of Polynomial Method
Decision parameter:
Initially, we have two decision parameters p1 0 in region 1 and p20 in region 2.
These parameters are defined as : p1 0 in region 1 is given as :
P10 = ry2 + 1 / 4rx2 - rx2ry
Mid-Point Ellipse Algorithm
Step 1: Start
Step 2: Declare rx , ry , x , y , m , dx , dy , P , P2.
Step 3: Initialize initial point of region1 as
x = 0 , y = ry
Step 4: Calculate P= ry2 + rx2 / 4 - ry rx2
dx = 2 ry2 x
dy = 2 rx2 y
Step 5: Update values of dx and dy after each iteration.
Step 6: Repeat steps while (dx < dy):
Plot (x,y)
if(P < 0)
Update x = x+1 ;
P += ry2 [2x + 3 ]
Else
Update x = x + 1
y= y - 1
Step 7: When dx ≥ dy, plot region 2:
Step 8: Calculate P2 = ry2 ( x+1 / 2)2 + rx2 (y -1)2- rx2ry2
Step 9: Repeat till (y > 0)
If (P2 > 0)
Update y = y-1 (x will remain same)
P2 =P2 -2 y rx2 + rx2
else
x = x+1
y = y-1
P2=P2+ 2 ry2 [2x] -2 y rx2 + rx2
Step 10: End
Advantages & Disadvantages
Advantages:
The mid-point ellipse algorithm has simple and easy implementation as it
only includes addition operations.
Disadvantages:
This algorithm is time consuming.
EXAMPLE 3 Midpoint Ellipse Drawing
Given input ellipse parameters rx = 8 and ry = 6, we illustrate the steps in the
midpoint ellipse algorithm by determining raster positions along the ellipse
path in the first quadrant.
Initial values and increments for the decision parameter calculations are
2ry2 x = 0 (with increment 2ry2 = 72)
2rx2 y = 2rx2 ry (with increment −2rx2 = −128)
For region 1, the initial point for the ellipse centered on the origin is (x0, y0)
= (0, 6), and the initial decision parameter value is
p10 = ry2 − rx2 ry + 1/4 rx2 = −332
Successive midpoint decision-parameter values and the pixel positions along
the ellipse are listed in the following table: