SlideShare a Scribd company logo
13
Most read
15
Most read
17
Most read
Computer Graphic - Lines, Circles and Ellipse
 For |m|<1
1. Input 2 line end points and store the left end point
in (x0,y0).
2. Load (x0,y0) into the frame buffer to plot the first
end point.
3. Calculate constants ∆x, ∆y, and 2∆y - 2∆x and 2∆y
and obtain the storing value for the decision
parameter as : P0 = 2∆y - ∆x.
4. At each xk along the line, starting at k = 0, do the
following test: if pk < 0, the next point to plot is
(xk+1, yk) and pk+1 = pk + 2∆y else, the next point to
plot is (xk+1, yk+1) and pk+1 = pk + 2∆y - 2∆x
5. Repeat step 4 ∆x times.
 Suppose we have the line with the 2 following end
points (20,10) and (30,18) use line drawing algorithm
to draw this line.
m=∆y / ∆x = 8/10 < 1.
Initial point : (20,10)
∆x = 10
∆y = 8
2∆y - 2∆x = -4
2∆y = 16
Initial decision parameter P0 = 2∆y - ∆x =16 – 10 = 6
(30,18)
(20,10)
k pk (xk+1,yk+1)
0 6 (21,11)
1 6-4 = 2 (22,12)
2 18-20 = -2 (23,12)
3 -2+16 = 14 (24,13)
4 14-4 = 10 (25,14)
5 6 (26,15)
6 2 (27,16)
7 -2 (28,16)
8 14 (29,17)
9 10 (30,18)
 For |m|>=1 Interchange the values of x and y (y is
always increasing in the table and the decision
parameter become :
P0 = 2∆x - ∆y and pk+1 = pk + 2∆x - 2∆y or pk + 2∆x .
 Suppose we have the line with the 2 following end
points (1,3) and (7,12) use line drawing algorithm to
draw this line.
m=∆y / ∆x = 9/6 > 1.
Initial point : (1,3)
∆x = 6
∆y = 9
2∆x - 2∆y = -6
2∆x = 12
Initial decision parameter P0 = 2∆x - ∆y = 3
(7,2)
(1,3)
k pk (xk+1,yk+1)
0 3 (2,4)
1 (3+12-18) = -3 (2,5)
2 9 (3,6)
3 3 (4,7)
4 -3 (4,8)
5 9 (5,9)
6 3 (6,10)
7 -3 (6,11)
8 9 (7,12)
 Suppose we have the line with the 2 following end
points (5,7) and (9,19) use line drawing algorithm to
draw this line.
m=∆y / ∆x = 12/4 > 1.
Initial point : (5,7)
∆x = 4
∆y = 12
2∆x - 2∆y = -16
2∆x = 8
Initial decision parameter P0 = 2∆x - ∆y = -4
(9,19)
(5,7)
k pk (xk+1,yk+1)
0 -4 (5,8)
1 4 (6,9)
2 -12 (6,10)
3 -4 (6,11)
4 4 (7,12)
5 -12 (7,13)
6 -4 (7,14)
7 4 (8,15)
8 -12 (8,16)
9 -4 (8,17)
10 4 (9,18)
11 -12 (9,19)
 Suppose we have the line with the 2 following end
points (2,6) and (8,7) use line drawing algorithm to
draw this line.
m=∆y / ∆x = 1/6 < 1.
Initial point : (2,6)
∆x = 6
∆y = 1
2∆y - 2∆x = -10
2∆y = 2
Initial decision parameter P0 = 2∆y - ∆x = -4
(8,7)
(2,6)
k pk (xk+1,yk+1)
0 -4 (3,6)
1 -2 (4,6)
2 0 (5,7)
3 -10 (6,7)
4 -8 (7,7)
5 -6 (8,7)
1. Input radius r and circle center (xi,yi) and obtain
the first point on the circumference of the circle
centered on the origin as (0,r).
2. Calculate the initial value of decision parameter
as p0 = 5/4 – r (if its integer 1-r).
3. At each xk position starting at k=0, perform the
following test: If pk < 0 then the next point on
circle centered on (0,0) is (xk+1,yk) and pk+1 =
pk+2xk+1+1 else the next point along the circle
centered on (0,0) is (xk+1,yk-1) and pk+1 =
pk+2xk+1+1-2yk+1
4. Repeat step 3 until x>=y.
 Given r=10 use midpoint circle algorithm to draw
circle.
Initial point : (0,10)
Initial decision parameter P0 = 1-r = -9
k pk (xk+1,yk+1) 2xk+1 2yk+1
0 -9 (1,10) 2 20
1 -6 (2,10) 4 20
2 -1 (3,10) 6 20
3 6 (4,9) 8 18
4 -3 (5,9) 10 18
5 8 (6,8) 12 16
6 5 (7,7) Stop 14 14
 Given r=14 use midpoint circle algorithm to draw
circle.
Initial point : (0,14) P0 = 1-r = -13
k pk (xk+1,yk+1) 2xk+1 2yk+1
0 -13 (1,14) 2 28
1 -10 (2,14) 4 28
2 -5 (3,14) 6 28
3 2 (4,13) 8 26
4 -15 (5,13) 10 26
5 -4 (6,13) 12 26
6 9 (7,12) 14 24
7 0 (8,11) 16 22
8 -5 (9,11) 18 22
9 14 (10,10)
1. Input rx, ry and ellipse center (xc,yc) and obtain the
first point on an ellipse centered (0,0) on the origins
as (x0,y0) = (0,ry).
2. Calculate the initial value of decision parameter in
region 1 as p10 = ry
2 - rx
2 ry + ¼ rx
2.
3. At each xk position in region 1 starting at k=0,
perform the following test: If p1k < 0 then the next
point along the ellipse centered on (0,0) is (xk+1,yk)
and p1k+1 = p1k+2ry
2xk+1+ry
2 else the next point along
the ellipse centered on (0,0) is (xk+1,yk-1) and p1k+1 =
p1k+2ry
2xk+1+ry
2-2rx
2yk+1.
4. Repeat the steps for region 1 until 2ry
2 xk+1>= 2rx
2
yk+1
4. Calculate the initial value of decision parameter
in region 2 using the last point (x0,y0)
calculated in region 1 as p20 = ry
2 (x0+½)2+rx
2 (y0-
1)2-rx
2ry
2
5. At each yk position in region 2 starting at k=0,
perform the following test: If p2k >= 0 then the
next point along the ellipse centered on (0,0) is
(xk,yk-1) and p2k+1 = p2k-2rx
2yk+1+rx
2 else the next
point along the ellipse centered on (0,0) is
(xk+1,yk+1) and p2k+1 = p2k+2ry
2xk+1-2rx
2yk+1+rx
2.
(Note: Use the same increment value for x and y
in region 1.)
6. Repeat the steps for region 2 until yk+1=0.
 Given ellipse parameter with rx=8 and ry=6 use
midpoint ellipse drawing to draw an ellipse.
Initial point for region 1 (0,ry)=(0,6).
2ry
2x= 0 (with increment value 2ry
2 = 2(6)2=72)
2rx
2y= 2rx
2ry= 2(8)2(6) (with increment value
–rx
2=-2(8)2=-128)
The initial decision parameter for region 1
p10 = ry
2 - rx
2 ry + ¼ rx
2 =(6)2 - (8)2(6) + ¼(8)2 =-332
k pk (xk+1,yk+1) 2ry
2 xk+1 2rx
2 yk+1
0 -332 (1,6) 72 768
1 -224 (2,6) 144 768
2 -44 (3,6) 216 768
3 208 (4,5) 288 640
4 -108 (5,5) 360 640
5 288 (6,4) 432 512
6 244 (7,3) 504 384
 Stop since 2ry
2 xk+1 > 2rx
2 yk+1
We now move to region 2
Initial point for region 2 (x0,y0)=(7,3).
The initial decision parameter for region 2
p20 = ry
2 (x0+½)2+rx
2 (y0-1)2-rx
2ry
2
=36(7.5)2+64(2)2-64*36= -151
k pk (xk+1,yk+1) 2ry
2 xk+1 2rx
2 yk+1
0 -151 (8,2) 576 256
1 233 (8,1) 576 128
2 745 (8,0) 576 0
 Given ellipse parameter with rx=8 and ry=10 use
midpoint ellipse drawing to draw an ellipse.
Initial point for region 1 (0,ry)=(0,10).
2ry
2x= 0 (with increment value 2ry
2 = 2(10)2=200)
2rx
2y= 2rx
2ry= 2(8)2(10) (with increment value
–rx
2=-2(8)2=-128)
The initial decision parameter for region 1
p10 = ry
2 - rx
2 ry + ¼ rx
2
=(10)2 - (8)2(10) + ¼(8)2 =-524
k pk (xk+1,yk+1) 2ry
2 xk+1 2rx
2 yk+1
0 -524 (1,10) 200 1280
1 -224 (2,10) 400 1280
2 276 (3,9) 600 1152
3 -176 (4,9) 800 1152
4 724 (5,8) 1000 1024
5 800 (6,7) 1200 896
We now move to region 2
Initial point for region 2 (x0,y0)=(6,7).
The initial decision parameter for region 2
p20 = ry
2 (x0+½)2+rx
2 (y0-1)2-rx
2ry
2
=100(6.5)2+64(6)2-64*100= 129
k pk (xk+1,yk+1) 2ry
2 xk+1 2rx
2 yk+1
0 129 (6,6) 1200 768
1 -703 (7,5) 1400 640
( ,0) Stop

More Related Content

PPTX
Overview of Graphics System
PPTX
Chapter 3 Output Primitives
PPTX
Bresenham's line algorithm
PPTX
Mid point circle algorithm
PDF
Computer Graphics - Output Primitive
DOC
COMPUTER GRAPHICS LAB MANUAL
PDF
Unit-1 basics of computer graphics
PPTX
Bresenham circle
Overview of Graphics System
Chapter 3 Output Primitives
Bresenham's line algorithm
Mid point circle algorithm
Computer Graphics - Output Primitive
COMPUTER GRAPHICS LAB MANUAL
Unit-1 basics of computer graphics
Bresenham circle

What's hot (20)

PPT
Polygon clipping
PPT
Circle drawing algo.
PPTX
Bresenham's line drawing algorithm
PPTX
Output primitives in Computer Graphics
PPTX
Cohen sutherland line clipping
PPT
Line drawing algo.
PPTX
Clipping in Computer Graphics
PPTX
Polygon filling algorithm
PPTX
COMPUTER GRAPHICS-"Projection"
PPTX
Computer graphics LINE DRAWING algorithm.pptx
PPTX
Circle generation algorithm
PPTX
Scan line method
PPTX
Computer graphics
PPTX
Window to viewport transformation&amp;matrix representation of homogeneous co...
PPT
Composite transformations
PPTX
Weiler atherton
PPTX
Computer graphics basic transformation
PPTX
Attributes of Output Primitives
PPT
Fill area algorithms
PPTX
Clipping
Polygon clipping
Circle drawing algo.
Bresenham's line drawing algorithm
Output primitives in Computer Graphics
Cohen sutherland line clipping
Line drawing algo.
Clipping in Computer Graphics
Polygon filling algorithm
COMPUTER GRAPHICS-"Projection"
Computer graphics LINE DRAWING algorithm.pptx
Circle generation algorithm
Scan line method
Computer graphics
Window to viewport transformation&amp;matrix representation of homogeneous co...
Composite transformations
Weiler atherton
Computer graphics basic transformation
Attributes of Output Primitives
Fill area algorithms
Clipping
Ad

Similar to Computer Graphic - Lines, Circles and Ellipse (20)

PDF
Lect4 ellipse
PPT
2D_line_circle.ppt
PPTX
Computer Graphics - Bresenham's line drawing algorithm & Mid Point Circle alg...
PPTX
Algorithm.pptx
PDF
UNIT 4-geometry of which and line drawing.pdf
PPTX
Computer graphics
PPT
PDF
Computer graphics lab report with code in cpp
PDF
Open GL 04 linealgos
PPT
2.Line,circle drawing.ppt line circlw drawing algorith
PPTX
chapter 3 , foley.pptxhuujjjjjjjkjmmmm. Ibibhvucufucuvivihohi
PDF
module 1.pdf
PPTX
dddddddddddddddddddddddddddddddddddddddddddddddddddddAlgorithm.pptx
DOC
Computer Aided Manufacturing Design
PPT
Lines and curves algorithms
PPTX
Mid point line Algorithm - Computer Graphics
PPT
Shape drawing algs
PPT
Computer_Graphics_circle_drawing_techniq.ppt
PDF
Chapter 2 Computer graphics by Kushal Bhattarai
PPTX
Computer Graphics
Lect4 ellipse
2D_line_circle.ppt
Computer Graphics - Bresenham's line drawing algorithm & Mid Point Circle alg...
Algorithm.pptx
UNIT 4-geometry of which and line drawing.pdf
Computer graphics
Computer graphics lab report with code in cpp
Open GL 04 linealgos
2.Line,circle drawing.ppt line circlw drawing algorith
chapter 3 , foley.pptxhuujjjjjjjkjmmmm. Ibibhvucufucuvivihohi
module 1.pdf
dddddddddddddddddddddddddddddddddddddddddddddddddddddAlgorithm.pptx
Computer Aided Manufacturing Design
Lines and curves algorithms
Mid point line Algorithm - Computer Graphics
Shape drawing algs
Computer_Graphics_circle_drawing_techniq.ppt
Chapter 2 Computer graphics by Kushal Bhattarai
Computer Graphics
Ad

More from 2013901097 (11)

PPTX
Operation research - the revised simplex method
PPTX
Computer Graphic - Clipping
PPTX
Computer Graphic - Projections
PPTX
Computer Graphic - Transformations in 3d
PPTX
Computer Graphic - Transformations in 2D
PPTX
the two phase method - operations research
PPTX
The Big M Method - Operation Research
PPTX
Operations research - Chapter 04
PPTX
Operation research - Chapter 03
PPTX
Operation research - Chapter 02
PPTX
Operation research - Chapter 01
Operation research - the revised simplex method
Computer Graphic - Clipping
Computer Graphic - Projections
Computer Graphic - Transformations in 3d
Computer Graphic - Transformations in 2D
the two phase method - operations research
The Big M Method - Operation Research
Operations research - Chapter 04
Operation research - Chapter 03
Operation research - Chapter 02
Operation research - Chapter 01

Recently uploaded (20)

PDF
IFIT3 RNA-binding activity primores influenza A viruz infection and translati...
PDF
Unveiling a 36 billion solar mass black hole at the centre of the Cosmic Hors...
PPT
protein biochemistry.ppt for university classes
PPTX
Cell Membrane: Structure, Composition & Functions
PPTX
Comparative Structure of Integument in Vertebrates.pptx
PPTX
2. Earth - The Living Planet earth and life
PPTX
Taita Taveta Laboratory Technician Workshop Presentation.pptx
PDF
An interstellar mission to test astrophysical black holes
PPTX
2. Earth - The Living Planet Module 2ELS
PDF
diccionario toefl examen de ingles para principiante
PPTX
G5Q1W8 PPT SCIENCE.pptx 2025-2026 GRADE 5
PDF
ELS_Q1_Module-11_Formation-of-Rock-Layers_v2.pdf
PPTX
Derivatives of integument scales, beaks, horns,.pptx
PDF
The scientific heritage No 166 (166) (2025)
PPT
Chemical bonding and molecular structure
PPTX
GEN. BIO 1 - CELL TYPES & CELL MODIFICATIONS
DOCX
Viruses (History, structure and composition, classification, Bacteriophage Re...
PDF
Mastering Bioreactors and Media Sterilization: A Complete Guide to Sterile Fe...
PPTX
Introduction to Fisheries Biotechnology_Lesson 1.pptx
PPT
POSITIONING IN OPERATION THEATRE ROOM.ppt
IFIT3 RNA-binding activity primores influenza A viruz infection and translati...
Unveiling a 36 billion solar mass black hole at the centre of the Cosmic Hors...
protein biochemistry.ppt for university classes
Cell Membrane: Structure, Composition & Functions
Comparative Structure of Integument in Vertebrates.pptx
2. Earth - The Living Planet earth and life
Taita Taveta Laboratory Technician Workshop Presentation.pptx
An interstellar mission to test astrophysical black holes
2. Earth - The Living Planet Module 2ELS
diccionario toefl examen de ingles para principiante
G5Q1W8 PPT SCIENCE.pptx 2025-2026 GRADE 5
ELS_Q1_Module-11_Formation-of-Rock-Layers_v2.pdf
Derivatives of integument scales, beaks, horns,.pptx
The scientific heritage No 166 (166) (2025)
Chemical bonding and molecular structure
GEN. BIO 1 - CELL TYPES & CELL MODIFICATIONS
Viruses (History, structure and composition, classification, Bacteriophage Re...
Mastering Bioreactors and Media Sterilization: A Complete Guide to Sterile Fe...
Introduction to Fisheries Biotechnology_Lesson 1.pptx
POSITIONING IN OPERATION THEATRE ROOM.ppt

Computer Graphic - Lines, Circles and Ellipse

  • 2.  For |m|<1 1. Input 2 line end points and store the left end point in (x0,y0). 2. Load (x0,y0) into the frame buffer to plot the first end point. 3. Calculate constants ∆x, ∆y, and 2∆y - 2∆x and 2∆y and obtain the storing value for the decision parameter as : P0 = 2∆y - ∆x. 4. At each xk along the line, starting at k = 0, do the following test: if pk < 0, the next point to plot is (xk+1, yk) and pk+1 = pk + 2∆y else, the next point to plot is (xk+1, yk+1) and pk+1 = pk + 2∆y - 2∆x 5. Repeat step 4 ∆x times.
  • 3.  Suppose we have the line with the 2 following end points (20,10) and (30,18) use line drawing algorithm to draw this line. m=∆y / ∆x = 8/10 < 1. Initial point : (20,10) ∆x = 10 ∆y = 8 2∆y - 2∆x = -4 2∆y = 16 Initial decision parameter P0 = 2∆y - ∆x =16 – 10 = 6 (30,18) (20,10)
  • 4. k pk (xk+1,yk+1) 0 6 (21,11) 1 6-4 = 2 (22,12) 2 18-20 = -2 (23,12) 3 -2+16 = 14 (24,13) 4 14-4 = 10 (25,14) 5 6 (26,15) 6 2 (27,16) 7 -2 (28,16) 8 14 (29,17) 9 10 (30,18)
  • 5.  For |m|>=1 Interchange the values of x and y (y is always increasing in the table and the decision parameter become : P0 = 2∆x - ∆y and pk+1 = pk + 2∆x - 2∆y or pk + 2∆x .
  • 6.  Suppose we have the line with the 2 following end points (1,3) and (7,12) use line drawing algorithm to draw this line. m=∆y / ∆x = 9/6 > 1. Initial point : (1,3) ∆x = 6 ∆y = 9 2∆x - 2∆y = -6 2∆x = 12 Initial decision parameter P0 = 2∆x - ∆y = 3 (7,2) (1,3)
  • 7. k pk (xk+1,yk+1) 0 3 (2,4) 1 (3+12-18) = -3 (2,5) 2 9 (3,6) 3 3 (4,7) 4 -3 (4,8) 5 9 (5,9) 6 3 (6,10) 7 -3 (6,11) 8 9 (7,12)
  • 8.  Suppose we have the line with the 2 following end points (5,7) and (9,19) use line drawing algorithm to draw this line. m=∆y / ∆x = 12/4 > 1. Initial point : (5,7) ∆x = 4 ∆y = 12 2∆x - 2∆y = -16 2∆x = 8 Initial decision parameter P0 = 2∆x - ∆y = -4 (9,19) (5,7)
  • 9. k pk (xk+1,yk+1) 0 -4 (5,8) 1 4 (6,9) 2 -12 (6,10) 3 -4 (6,11) 4 4 (7,12) 5 -12 (7,13) 6 -4 (7,14) 7 4 (8,15) 8 -12 (8,16) 9 -4 (8,17) 10 4 (9,18) 11 -12 (9,19)
  • 10.  Suppose we have the line with the 2 following end points (2,6) and (8,7) use line drawing algorithm to draw this line. m=∆y / ∆x = 1/6 < 1. Initial point : (2,6) ∆x = 6 ∆y = 1 2∆y - 2∆x = -10 2∆y = 2 Initial decision parameter P0 = 2∆y - ∆x = -4 (8,7) (2,6)
  • 11. k pk (xk+1,yk+1) 0 -4 (3,6) 1 -2 (4,6) 2 0 (5,7) 3 -10 (6,7) 4 -8 (7,7) 5 -6 (8,7)
  • 12. 1. Input radius r and circle center (xi,yi) and obtain the first point on the circumference of the circle centered on the origin as (0,r). 2. Calculate the initial value of decision parameter as p0 = 5/4 – r (if its integer 1-r). 3. At each xk position starting at k=0, perform the following test: If pk < 0 then the next point on circle centered on (0,0) is (xk+1,yk) and pk+1 = pk+2xk+1+1 else the next point along the circle centered on (0,0) is (xk+1,yk-1) and pk+1 = pk+2xk+1+1-2yk+1 4. Repeat step 3 until x>=y.
  • 13.  Given r=10 use midpoint circle algorithm to draw circle. Initial point : (0,10) Initial decision parameter P0 = 1-r = -9 k pk (xk+1,yk+1) 2xk+1 2yk+1 0 -9 (1,10) 2 20 1 -6 (2,10) 4 20 2 -1 (3,10) 6 20 3 6 (4,9) 8 18 4 -3 (5,9) 10 18 5 8 (6,8) 12 16 6 5 (7,7) Stop 14 14
  • 14.  Given r=14 use midpoint circle algorithm to draw circle. Initial point : (0,14) P0 = 1-r = -13 k pk (xk+1,yk+1) 2xk+1 2yk+1 0 -13 (1,14) 2 28 1 -10 (2,14) 4 28 2 -5 (3,14) 6 28 3 2 (4,13) 8 26 4 -15 (5,13) 10 26 5 -4 (6,13) 12 26 6 9 (7,12) 14 24 7 0 (8,11) 16 22 8 -5 (9,11) 18 22 9 14 (10,10)
  • 15. 1. Input rx, ry and ellipse center (xc,yc) and obtain the first point on an ellipse centered (0,0) on the origins as (x0,y0) = (0,ry). 2. Calculate the initial value of decision parameter in region 1 as p10 = ry 2 - rx 2 ry + ¼ rx 2. 3. At each xk position in region 1 starting at k=0, perform the following test: If p1k < 0 then the next point along the ellipse centered on (0,0) is (xk+1,yk) and p1k+1 = p1k+2ry 2xk+1+ry 2 else the next point along the ellipse centered on (0,0) is (xk+1,yk-1) and p1k+1 = p1k+2ry 2xk+1+ry 2-2rx 2yk+1. 4. Repeat the steps for region 1 until 2ry 2 xk+1>= 2rx 2 yk+1
  • 16. 4. Calculate the initial value of decision parameter in region 2 using the last point (x0,y0) calculated in region 1 as p20 = ry 2 (x0+½)2+rx 2 (y0- 1)2-rx 2ry 2 5. At each yk position in region 2 starting at k=0, perform the following test: If p2k >= 0 then the next point along the ellipse centered on (0,0) is (xk,yk-1) and p2k+1 = p2k-2rx 2yk+1+rx 2 else the next point along the ellipse centered on (0,0) is (xk+1,yk+1) and p2k+1 = p2k+2ry 2xk+1-2rx 2yk+1+rx 2. (Note: Use the same increment value for x and y in region 1.) 6. Repeat the steps for region 2 until yk+1=0.
  • 17.  Given ellipse parameter with rx=8 and ry=6 use midpoint ellipse drawing to draw an ellipse. Initial point for region 1 (0,ry)=(0,6). 2ry 2x= 0 (with increment value 2ry 2 = 2(6)2=72) 2rx 2y= 2rx 2ry= 2(8)2(6) (with increment value –rx 2=-2(8)2=-128) The initial decision parameter for region 1 p10 = ry 2 - rx 2 ry + ¼ rx 2 =(6)2 - (8)2(6) + ¼(8)2 =-332
  • 18. k pk (xk+1,yk+1) 2ry 2 xk+1 2rx 2 yk+1 0 -332 (1,6) 72 768 1 -224 (2,6) 144 768 2 -44 (3,6) 216 768 3 208 (4,5) 288 640 4 -108 (5,5) 360 640 5 288 (6,4) 432 512 6 244 (7,3) 504 384  Stop since 2ry 2 xk+1 > 2rx 2 yk+1
  • 19. We now move to region 2 Initial point for region 2 (x0,y0)=(7,3). The initial decision parameter for region 2 p20 = ry 2 (x0+½)2+rx 2 (y0-1)2-rx 2ry 2 =36(7.5)2+64(2)2-64*36= -151 k pk (xk+1,yk+1) 2ry 2 xk+1 2rx 2 yk+1 0 -151 (8,2) 576 256 1 233 (8,1) 576 128 2 745 (8,0) 576 0
  • 20.  Given ellipse parameter with rx=8 and ry=10 use midpoint ellipse drawing to draw an ellipse. Initial point for region 1 (0,ry)=(0,10). 2ry 2x= 0 (with increment value 2ry 2 = 2(10)2=200) 2rx 2y= 2rx 2ry= 2(8)2(10) (with increment value –rx 2=-2(8)2=-128) The initial decision parameter for region 1 p10 = ry 2 - rx 2 ry + ¼ rx 2 =(10)2 - (8)2(10) + ¼(8)2 =-524
  • 21. k pk (xk+1,yk+1) 2ry 2 xk+1 2rx 2 yk+1 0 -524 (1,10) 200 1280 1 -224 (2,10) 400 1280 2 276 (3,9) 600 1152 3 -176 (4,9) 800 1152 4 724 (5,8) 1000 1024 5 800 (6,7) 1200 896
  • 22. We now move to region 2 Initial point for region 2 (x0,y0)=(6,7). The initial decision parameter for region 2 p20 = ry 2 (x0+½)2+rx 2 (y0-1)2-rx 2ry 2 =100(6.5)2+64(6)2-64*100= 129 k pk (xk+1,yk+1) 2ry 2 xk+1 2rx 2 yk+1 0 129 (6,6) 1200 768 1 -703 (7,5) 1400 640 ( ,0) Stop