0 votes
104 views
in Computer Graphics by (98.9k points)
retagged by
midpoint ellipse drawing algorithm in computer graphics

1 Answer

0 votes
by (98.9k points)
selected by
 
Best answer

Mid-Point Ellipse Algorithm :

  1. Take input radius along x axis and y axis and obtain center of ellipse.
  2. Initially, we assume ellipse to be centered at origin and the first point as : (x, y0)= (0, ry).
  3. Obtain the initial decision parameter for region 1 as: p10=ry2+1/4rx2-rx 2ry
  4. For every xk position in region 1 :
    If p1k<0 then the next point along the is (xk+1, yk) and p1k+1=p1k+2ry2xk+1+ry2
    Else, the next point is (xk+1, yk-1 )
    And p1k+1=p1k+2ry2xk+1 – 2rx2yk+1+ry2
  5. Obtain the initial value in region 2 using the last point (x0, y0) of region 1 as: p20=ry2(x0+1/2)2+rx2 (y0-1)2-rx2ry2
  6. At each yk in region 2 starting at k =0 perform the following task.
    If p2k>0 the next point is (xk, yk-1) and p2k+1=p2k-2rx2yk+1+rx2
  7. Else, the next point is (xk+1, yk -1) and p2k+1=p2k+2ry2xk+1 -2rx2yk+1+rx2
  8. Now obtain the symmetric points in the three quadrants and plot the coordinate value as: x=x+xc, y=y+yc
  9. Repeat the steps for region 1 until 2ry2x>=2rx2y

Related questions

0 votes
1 answer 64 views
0 votes
1 answer 80 views
0 votes
1 answer 104 views

Doubtly is an online community for engineering students, offering:

  • Free viva questions PDFs
  • Previous year question papers (PYQs)
  • Academic doubt solutions
  • Expert-guided solutions

Get the pro version for free by logging in!

5.7k questions

5.1k answers

108 comments

557 users

...