SlideShare a Scribd company logo
1 of 6
COMPUTER GRAPHICS
MidPoint Ellipse Drawing Algorithm
By: Ms. Rachana Marathe
Algorithm: Ellipse drawing
Input (rx, ry) centered at origin and the first point is (x0,y0)=(0,ry)
Region 1 :
P10 = ry
2 – rx
2 ry +1/4 rx
2
If p1k < 0 then (xk+1, yk) and
P1k+1 = p1k +2ry
2 xk+1 + ry
2
Else (xk+1, yk-1)
P1k+1 = p1k +2ry
2 xk+1 - 2rx
2 yk+1 + ry
2
And continue till 2ry
2 x >= 2rx
2 y
Region 2:
Here (x0,y0) is the last point calculated in region1
P20= ry
2 (x0 +1/2)2 +rx
2 (y0 -1)2 - rx2ry2
If P2k >0 then (xk, yk-1) and
P2k+1 = p2k -2rx
2 yk+1 + rx
2
Else (xk+1, yk-1)
P2k+1 = p2k +2ry
2 xk+1 - 2rx
2 yk+1 + rx
2
Till y=0, i.e. last point is (rx,0)
Example 1: rx = 10, ry= 5
Algorithm: Region 1
P10 = ry
2 – rx
2 ry +1/4 rx
2
If p1k < 0 then (xk+1, yk)
And P1k+1 = p1k +2ry
2 xk+1 + ry
2
Else (xk+1, yk-1)
And P1k+1 = p1k +2ry
2 xk+1 - 2rx
2 yk+1 + ry
2
And continue till 2ry
2 x >= 2rx
2 y
Solution: (x0,y0)=(0,ry) = (0,5)
rx2 = 100 ry2 = 25 2rx2 = 200 2ry2 = 50
P10 = ry
2 – rx
2 ry +1/4 rx
2 = -450
(x,y) = (1,5) (if case)
P1k+1 = p1k +2ry
2 xk+1 + ry
2 = -375
(x,y) = (2,5) (if case)
P1k+1 = p1k +2ry
2 xk+1 + ry
2 = -250
(x,y) = (3,5) (if case)
P1k+1 = p1k +2ry
2 xk+1 + ry
2 = -75
(x,y) = (4,5) (if case)
P1k+1 = p1k +2ry
2 xk+1 + ry
2 = 150
(x,y) = (5,4) (else case)
P1k+1 = p1k +2ry
2 xk+1 - 2rx
2 yk+1 + ry
2 = -375
(x,y) = (6,4) (if case)
Algorithm: Region 2
Here (x0,y0) is the last point calculated in region1
P20= ry
2 (x0 +1/2)2 +rx
2 (y0 -1)2 - rx2ry2
If P2k >0 then (xk, yk-1)
And P2k+1 = p2k -2rx
2 yk+1 + rx
2
Else (xk+1, yk-1)
And P2k+1 = p2k +2ry
2 xk+1 - 2rx
2 yk+1 + rx
2
Till y=0, i.e. last point is (rx,0)
Solution: the first point will be the last (x,y) of region 1
(x,y)= (9,2)
P20= ry
2 (x0 +1/2)2 +rx
2 (y0 -1)2 - rx2ry2 = -143.75
(x, y) = (10,1) (else case)
P2k+1 = p2k +2ry
2 xk+1 - 2rx
2 yk+1 + rx
2 = 131.25
(x, y) = (10,0) (if case)
We STOP here when we reach (rx,0)
Therefore the pixels are
(0,5) (1,5) (2,5) (3,5) (4,5) (5,4) (6,4) (7,4) (8,3) (9,2) (10,1) (10,0)
Reference
Hearn,Baker - Computer Graphics - C Version 2nd Ed
http://edu.uokufa.edu.iq/staff/dr.nidhal/compressed%20comp.book/H
earn,Baker%20-%20Computer%20Graphics%20-
%20C%20Version%202nd%20Ed.pdf

More Related Content

What's hot

Computer graphics iv unit
Computer graphics iv unitComputer graphics iv unit
Computer graphics iv unitaravindangc
 
Midpoint circle algo
Midpoint circle algoMidpoint circle algo
Midpoint circle algoMohd Arif
 
Computer graphics lab report with code in cpp
Computer graphics lab report with code in cppComputer graphics lab report with code in cpp
Computer graphics lab report with code in cppAlamgir Hossain
 
Optimal binary search tree
Optimal binary search treeOptimal binary search tree
Optimal binary search treeKavya P
 
Mid point circle algorithm
Mid point circle algorithmMid point circle algorithm
Mid point circle algorithmMani Kanth
 
Computer Graphics - Bresenham's line drawing algorithm & Mid Point Circle alg...
Computer Graphics - Bresenham's line drawing algorithm & Mid Point Circle alg...Computer Graphics - Bresenham's line drawing algorithm & Mid Point Circle alg...
Computer Graphics - Bresenham's line drawing algorithm & Mid Point Circle alg...Saikrishna Tanguturu
 
01 knapsack using backtracking
01 knapsack using backtracking01 knapsack using backtracking
01 knapsack using backtrackingmandlapure
 
Two dimensional geometric transformations
Two dimensional geometric transformationsTwo dimensional geometric transformations
Two dimensional geometric transformationsMohammad Sadiq
 
Bresenham's line drawing algorithm
Bresenham's line drawing algorithmBresenham's line drawing algorithm
Bresenham's line drawing algorithmnehrurevathy
 
Bresenham's line drawing algorithm
Bresenham's line drawing algorithmBresenham's line drawing algorithm
Bresenham's line drawing algorithmMani Kanth
 
Computer graphics chapter 4
Computer graphics chapter 4Computer graphics chapter 4
Computer graphics chapter 4PrathimaBaliga
 
Line drawing algo.
Line drawing algo.Line drawing algo.
Line drawing algo.Mohd Arif
 
Bressenham’s Midpoint Circle Drawing Algorithm
Bressenham’s Midpoint Circle Drawing AlgorithmBressenham’s Midpoint Circle Drawing Algorithm
Bressenham’s Midpoint Circle Drawing AlgorithmMrinmoy Dalal
 
Circle generation algorithm
Circle generation algorithmCircle generation algorithm
Circle generation algorithmAnkit Garg
 
2 d geometric transformations
2 d geometric transformations2 d geometric transformations
2 d geometric transformationsMohd Arif
 
Computer graphics - bresenham line drawing algorithm
Computer graphics - bresenham line drawing algorithmComputer graphics - bresenham line drawing algorithm
Computer graphics - bresenham line drawing algorithmRuchi Maurya
 

What's hot (20)

Clipping
ClippingClipping
Clipping
 
Computer graphics
Computer graphicsComputer graphics
Computer graphics
 
Computer graphics iv unit
Computer graphics iv unitComputer graphics iv unit
Computer graphics iv unit
 
Midpoint circle algo
Midpoint circle algoMidpoint circle algo
Midpoint circle algo
 
Computer graphics lab report with code in cpp
Computer graphics lab report with code in cppComputer graphics lab report with code in cpp
Computer graphics lab report with code in cpp
 
Optimal binary search tree
Optimal binary search treeOptimal binary search tree
Optimal binary search tree
 
Polygon filling
Polygon fillingPolygon filling
Polygon filling
 
Mid point circle algorithm
Mid point circle algorithmMid point circle algorithm
Mid point circle algorithm
 
Computer Graphics - Bresenham's line drawing algorithm & Mid Point Circle alg...
Computer Graphics - Bresenham's line drawing algorithm & Mid Point Circle alg...Computer Graphics - Bresenham's line drawing algorithm & Mid Point Circle alg...
Computer Graphics - Bresenham's line drawing algorithm & Mid Point Circle alg...
 
01 knapsack using backtracking
01 knapsack using backtracking01 knapsack using backtracking
01 knapsack using backtracking
 
Two dimensional geometric transformations
Two dimensional geometric transformationsTwo dimensional geometric transformations
Two dimensional geometric transformations
 
Bresenham's line drawing algorithm
Bresenham's line drawing algorithmBresenham's line drawing algorithm
Bresenham's line drawing algorithm
 
Bresenham's line drawing algorithm
Bresenham's line drawing algorithmBresenham's line drawing algorithm
Bresenham's line drawing algorithm
 
Bezier curve computer graphics
Bezier curve computer graphics Bezier curve computer graphics
Bezier curve computer graphics
 
Computer graphics chapter 4
Computer graphics chapter 4Computer graphics chapter 4
Computer graphics chapter 4
 
Line drawing algo.
Line drawing algo.Line drawing algo.
Line drawing algo.
 
Bressenham’s Midpoint Circle Drawing Algorithm
Bressenham’s Midpoint Circle Drawing AlgorithmBressenham’s Midpoint Circle Drawing Algorithm
Bressenham’s Midpoint Circle Drawing Algorithm
 
Circle generation algorithm
Circle generation algorithmCircle generation algorithm
Circle generation algorithm
 
2 d geometric transformations
2 d geometric transformations2 d geometric transformations
2 d geometric transformations
 
Computer graphics - bresenham line drawing algorithm
Computer graphics - bresenham line drawing algorithmComputer graphics - bresenham line drawing algorithm
Computer graphics - bresenham line drawing algorithm
 

Similar to Comuter graphics ellipse drawing algorithm (20)

Computer Graphics - lines, Circles and ellipse
Computer Graphics - lines, Circles and ellipseComputer Graphics - lines, Circles and ellipse
Computer Graphics - lines, Circles and ellipse
 
Circle algorithm
Circle algorithmCircle algorithm
Circle algorithm
 
Computer_Graphics_circle_drawing_techniq.ppt
Computer_Graphics_circle_drawing_techniq.pptComputer_Graphics_circle_drawing_techniq.ppt
Computer_Graphics_circle_drawing_techniq.ppt
 
10994479.ppt
10994479.ppt10994479.ppt
10994479.ppt
 
35182797 additional-mathematics-form-4-and-5-notes
35182797 additional-mathematics-form-4-and-5-notes35182797 additional-mathematics-form-4-and-5-notes
35182797 additional-mathematics-form-4-and-5-notes
 
Computer graphics
Computer graphicsComputer graphics
Computer graphics
 
Lect4 ellipse
Lect4 ellipseLect4 ellipse
Lect4 ellipse
 
Modul 3 quadratic function
Modul 3 quadratic functionModul 3 quadratic function
Modul 3 quadratic function
 
Maths05
Maths05Maths05
Maths05
 
Basic m4-2-chapter1
Basic m4-2-chapter1Basic m4-2-chapter1
Basic m4-2-chapter1
 
Comuter graphics bresenhams circle drawing algorithm
Comuter graphics bresenhams circle drawing algorithmComuter graphics bresenhams circle drawing algorithm
Comuter graphics bresenhams circle drawing algorithm
 
10CSL67 CG LAB PROGRAM 6
10CSL67 CG LAB PROGRAM 610CSL67 CG LAB PROGRAM 6
10CSL67 CG LAB PROGRAM 6
 
Ejerciciosderivadasresueltos
EjerciciosderivadasresueltosEjerciciosderivadasresueltos
Ejerciciosderivadasresueltos
 
Lec05 circle ellipse
Lec05 circle ellipseLec05 circle ellipse
Lec05 circle ellipse
 
Lines and curves algorithms
Lines and curves algorithmsLines and curves algorithms
Lines and curves algorithms
 
MA8353 TPDE
MA8353 TPDEMA8353 TPDE
MA8353 TPDE
 
Unit 3
Unit 3Unit 3
Unit 3
 
mid point algorithm.pdf
mid point algorithm.pdfmid point algorithm.pdf
mid point algorithm.pdf
 
Interpolation functions
Interpolation functionsInterpolation functions
Interpolation functions
 
Presentation - MA181 - Final
Presentation - MA181 - FinalPresentation - MA181 - Final
Presentation - MA181 - Final
 

Recently uploaded

CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 
microprocessor 8085 and its interfacing
microprocessor 8085  and its interfacingmicroprocessor 8085  and its interfacing
microprocessor 8085 and its interfacingjaychoudhary37
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxvipinkmenon1
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and usesDevarapalliHaritha
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxPoojaBan
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLDeelipZope
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girlsssuser7cb4ff
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 

Recently uploaded (20)

CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 
microprocessor 8085 and its interfacing
microprocessor 8085  and its interfacingmicroprocessor 8085  and its interfacing
microprocessor 8085 and its interfacing
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptx
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and uses
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptx
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCL
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girls
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 

Comuter graphics ellipse drawing algorithm

  • 1. COMPUTER GRAPHICS MidPoint Ellipse Drawing Algorithm By: Ms. Rachana Marathe
  • 2. Algorithm: Ellipse drawing Input (rx, ry) centered at origin and the first point is (x0,y0)=(0,ry) Region 1 : P10 = ry 2 – rx 2 ry +1/4 rx 2 If p1k < 0 then (xk+1, yk) and P1k+1 = p1k +2ry 2 xk+1 + ry 2 Else (xk+1, yk-1) P1k+1 = p1k +2ry 2 xk+1 - 2rx 2 yk+1 + ry 2 And continue till 2ry 2 x >= 2rx 2 y Region 2: Here (x0,y0) is the last point calculated in region1 P20= ry 2 (x0 +1/2)2 +rx 2 (y0 -1)2 - rx2ry2 If P2k >0 then (xk, yk-1) and P2k+1 = p2k -2rx 2 yk+1 + rx 2 Else (xk+1, yk-1) P2k+1 = p2k +2ry 2 xk+1 - 2rx 2 yk+1 + rx 2 Till y=0, i.e. last point is (rx,0)
  • 3. Example 1: rx = 10, ry= 5 Algorithm: Region 1 P10 = ry 2 – rx 2 ry +1/4 rx 2 If p1k < 0 then (xk+1, yk) And P1k+1 = p1k +2ry 2 xk+1 + ry 2 Else (xk+1, yk-1) And P1k+1 = p1k +2ry 2 xk+1 - 2rx 2 yk+1 + ry 2 And continue till 2ry 2 x >= 2rx 2 y Solution: (x0,y0)=(0,ry) = (0,5) rx2 = 100 ry2 = 25 2rx2 = 200 2ry2 = 50 P10 = ry 2 – rx 2 ry +1/4 rx 2 = -450 (x,y) = (1,5) (if case) P1k+1 = p1k +2ry 2 xk+1 + ry 2 = -375 (x,y) = (2,5) (if case) P1k+1 = p1k +2ry 2 xk+1 + ry 2 = -250 (x,y) = (3,5) (if case) P1k+1 = p1k +2ry 2 xk+1 + ry 2 = -75 (x,y) = (4,5) (if case) P1k+1 = p1k +2ry 2 xk+1 + ry 2 = 150 (x,y) = (5,4) (else case) P1k+1 = p1k +2ry 2 xk+1 - 2rx 2 yk+1 + ry 2 = -375 (x,y) = (6,4) (if case)
  • 4. Algorithm: Region 2 Here (x0,y0) is the last point calculated in region1 P20= ry 2 (x0 +1/2)2 +rx 2 (y0 -1)2 - rx2ry2 If P2k >0 then (xk, yk-1) And P2k+1 = p2k -2rx 2 yk+1 + rx 2 Else (xk+1, yk-1) And P2k+1 = p2k +2ry 2 xk+1 - 2rx 2 yk+1 + rx 2 Till y=0, i.e. last point is (rx,0) Solution: the first point will be the last (x,y) of region 1 (x,y)= (9,2) P20= ry 2 (x0 +1/2)2 +rx 2 (y0 -1)2 - rx2ry2 = -143.75 (x, y) = (10,1) (else case) P2k+1 = p2k +2ry 2 xk+1 - 2rx 2 yk+1 + rx 2 = 131.25 (x, y) = (10,0) (if case) We STOP here when we reach (rx,0)
  • 5. Therefore the pixels are (0,5) (1,5) (2,5) (3,5) (4,5) (5,4) (6,4) (7,4) (8,3) (9,2) (10,1) (10,0)
  • 6. Reference Hearn,Baker - Computer Graphics - C Version 2nd Ed http://edu.uokufa.edu.iq/staff/dr.nidhal/compressed%20comp.book/H earn,Baker%20-%20Computer%20Graphics%20- %20C%20Version%202nd%20Ed.pdf