You are on page 1of 2

Midpoint Ellipse Algorithm

1. Input r,, r,, and ellipse center (x,, y,), and


obtain the first point on an
ellipse centered on the origin as
2. Calculate the initial value of thedecision
parameter in region 1 as
3. At each x, position in region 1, starting at
k = 3, perform the following
test: If pl, < 0, the next point along the
ellipse centered on (0, 0)
is (x, . I, yI) and
Otherwise, the next point along the circle is
(xk + 1, yr, - 1) and
with
and continue until 2 r i x 2 2rty.
4. Calculate the initial value of the decision
parameter in region 2 using
the last point (xo, yo) calculated in region 1
as
5. At each yk position in region 2, starting at
k = 0, perform the following
test: If pZk> 0, the next point along the
ellipse centered on (0, 0) is
(xk, yk .- 1) and
Otherwise, the next point along the circle is
(.rk + 1, yt - 1) and
using the same incremental calculations for
.I and y as in region 1.
6. Determine symmetry points in the other
three quadrants.
7. Move each calculated pixel position (x, y)
onto the elliptical path centered
on (x,, y,) and plot the coordinate values:
8. Repeat the steps for region 1 until 2 6 x 2
2rf.y

You might also like