SlideShare a Scribd company logo
1 of 15
BRESSENHAM’S MIDPOINT
CIRCLE DRAWING ALGORITHM
(EXPLAINED)
WHAT IS A CIRCLE?
• A circle is the set of all points in a plane that are
at a given distance from a given point, the
centre.
• Equivalently it is the curve traced out by a point
that moves so that its distance from a given
point is constant.
• A circle may also be defined as a special ellipse
in which the two foci are coincident and the
eccentricity is 0.
GENERATING CIRCLES
Circle equation : f(x,y) = x2 + y2 – r2
Any point on the circumference of the circle will satisfy the above
equation.
Hence :
>0  Point is outside the boundary of the circle
f(x,y) =0  Point is on the boundary of the circle
<=  Point is inside the boundary of the circle
FIRST OCTANT
• For a pixel at (xk, yk) the next pixel (xk +1, yk) or at (xk+1,
yk–1) is closer to the circle.
• The pixel point Pk for a corresponding point on the circle
is given as:
Pk = f(xk + 1, yk – ½) = (xk + 1)2 + yk - ½)2 – r2
• The next pixel point Pk+1 is given as:
Pk+1 = f(xk+1 + 1, yk+1 - ½) = [(xk + 1) + 1]2 + (yk+1 - ½ )2 – r2
(xk +1, yk)
(xk+1, yk–1)
Expanding Pk and Pk+1 and subtracting them, the eq. obtained is:
Pk+1 = Pk + 2(xk+1) + (y2
k+1 – y2
k) – (yk+1 – yk) + 1
(where the next Y – coordinate (yk+1) is either yk or yk-1 depending on
the sign of Pk.)
Since xk+1 denotes the next point along the X – axis (going rightwards)
xk+1 = xk + 1  2(xk+1) = 2xk + 2
Since yk+1 denotes the next point along the Y – axis (going downwards)
yk+1 = yk - 1  2(yk+1) = 2yk - 2
We’ve have to begin somewhere. So let the
starting position be (x0,y0) = (0, r)
Substituting these values in the circle
equation, P0 = f(1, r – ½) = 𝟓
𝟒 - r
Since r is a integer, neglecting the small
value of ¼, we have P0 = 1 - r
(0, r)
(0, 0)
BRESSENHAM’S ALGORITHM
1. Input radius r and centre of the circle (xc, yc), and obtain the first
point on the circumference of a circle centred on the origin as
(x0, y0) = (0, r)
2. Calculate the initial value of the decision parameter as
P0 = 1 – r
where r is the radius of the circle
3. At each xk position, starting at k= 0, perform the following test:
If (Pk < 0), then the NEXT POINT along the circle centred on (0, 0) is
(xk+1, yk) and Pk+1 = Pk + 2xk+1 +1
 Pk+1 = Pk + 2xk + 3
Otherwise, the NEXT POINT along the circle is
(xk+1, yk–1) and Pk+1 = Pk + 2xk+1 + 1 – 2yk+1
 Pk+1 = Pk + 2xk – 2yk + 5
2xk+1 = 2xk + 2
2yk+1 = 2yk – 2
4. Determine the Symmetry Points on the other 7 Octants
5. Move each calculated pixel position (x,y) onto the circular path
centered at (xc,yc) and plot the coordinate values as
x = x + xc and y = y + yc
6. Repeat steps 3 to 5 until x >= y
FOR EXAMPLE
Consider a circle that has to be drawn with its center at (0, 0) and a
radius of 10:
Initial point on the circumference of the circle is (0, r) = (0 ,10)
Initial pixel P0 = 1 – r = 1 – 10 = -9
Therefore, x = 0, y = 10, 2x = 0, 2y = 20, P0 = -9
Applying Bressenham’s Algorithm, we tabulate the data into a table
Pk Formula Pk Xk Yk
Initial Values -9 0 10
<0  -9 + 2(0) + 3 = -6 1 10
<0  -6 + 2(1) + 3 = -1 2 10
<0  -1 + 2(2) + 3 = 6 3 10
>0  6 + 2(3) -2(10) + 5 = -3 4 9
<0  -3 + 2(4) + 3 = 8 5 9
>0  8 + 2(5) – 2(9) + 5 = 5 6 8
>0  5 + 2(6) – 2(8) + 5 = 6 7 7
>0  6 + 2(7) – 2(7) + 5 = 11 8 6
REMEMBER:
xk+1 and yk+1 is
derived based on
the sign of Pk
REMEMBER:
Pk+1 derived
from Pk,
xk and yk
First calculate xk+1 and yk+1 values from Pk and then Pk+1 from Pk, xk, yk
11
9
8
7
6
5
4
3
2
1
0 1 2 3 4 5 6 7 8 9 10 11
• This is what the output
would look like.
• Only the first Octant is
shown.
• The Remaining Octants can
be derived symmetrically by
changing the signs.
FINAL RENDER
Prepared by
Mrinmoy Dalal
13311A0506
S.N.I.S.T.

More Related Content

What's hot

Computer graphics - bresenham line drawing algorithm
Computer graphics - bresenham line drawing algorithmComputer graphics - bresenham line drawing algorithm
Computer graphics - bresenham line drawing algorithmRuchi Maurya
 
Midpoint circle algo
Midpoint circle algoMidpoint circle algo
Midpoint circle algoMohd Arif
 
Computer Graphics - Output Primitive
Computer Graphics - Output PrimitiveComputer Graphics - Output Primitive
Computer Graphics - Output PrimitiveRupesh Mishra
 
Output primitives in Computer Graphics
Output primitives in Computer GraphicsOutput primitives in Computer Graphics
Output primitives in Computer GraphicsKamal Acharya
 
Chapter 3 Output Primitives
Chapter 3 Output PrimitivesChapter 3 Output Primitives
Chapter 3 Output PrimitivesPrathimaBaliga
 
Comuter graphics ellipse drawing algorithm
Comuter graphics ellipse drawing algorithmComuter graphics ellipse drawing algorithm
Comuter graphics ellipse drawing algorithmRachana Marathe
 
Computer Graphic - Lines, Circles and Ellipse
Computer Graphic - Lines, Circles and EllipseComputer Graphic - Lines, Circles and Ellipse
Computer Graphic - Lines, Circles and Ellipse2013901097
 
Dda line algorithm presentatiion
Dda line algorithm presentatiionDda line algorithm presentatiion
Dda line algorithm presentatiionMuhammadHamza401
 
Line Drawing Algorithms - Computer Graphics - Notes
Line Drawing Algorithms - Computer Graphics - NotesLine Drawing Algorithms - Computer Graphics - Notes
Line Drawing Algorithms - Computer Graphics - NotesOmprakash Chauhan
 
Circle drawing algo.
Circle drawing algo.Circle drawing algo.
Circle drawing algo.Mohd Arif
 
Filtering in frequency domain
Filtering in frequency domainFiltering in frequency domain
Filtering in frequency domainGowriLatha1
 
Bresenham's line algorithm
Bresenham's line algorithmBresenham's line algorithm
Bresenham's line algorithmPooja Dixit
 
Mid-Point Cirle Drawing Algorithm
Mid-Point Cirle Drawing AlgorithmMid-Point Cirle Drawing Algorithm
Mid-Point Cirle Drawing AlgorithmNeha Kaurav
 
Scan line method
Scan line methodScan line method
Scan line methodPooja Dixit
 
Anti- aliasing computer graphics
Anti- aliasing computer graphicsAnti- aliasing computer graphics
Anti- aliasing computer graphicsSafayet Hossain
 
Random scan displays and raster scan displays
Random scan displays and raster scan displaysRandom scan displays and raster scan displays
Random scan displays and raster scan displaysSomya Bagai
 

What's hot (20)

Computer graphics - bresenham line drawing algorithm
Computer graphics - bresenham line drawing algorithmComputer graphics - bresenham line drawing algorithm
Computer graphics - bresenham line drawing algorithm
 
Midpoint circle algo
Midpoint circle algoMidpoint circle algo
Midpoint circle algo
 
Computer Graphics - Output Primitive
Computer Graphics - Output PrimitiveComputer Graphics - Output Primitive
Computer Graphics - Output Primitive
 
Output primitives in Computer Graphics
Output primitives in Computer GraphicsOutput primitives in Computer Graphics
Output primitives in Computer Graphics
 
Chapter 3 Output Primitives
Chapter 3 Output PrimitivesChapter 3 Output Primitives
Chapter 3 Output Primitives
 
Comuter graphics ellipse drawing algorithm
Comuter graphics ellipse drawing algorithmComuter graphics ellipse drawing algorithm
Comuter graphics ellipse drawing algorithm
 
Computer Graphic - Lines, Circles and Ellipse
Computer Graphic - Lines, Circles and EllipseComputer Graphic - Lines, Circles and Ellipse
Computer Graphic - Lines, Circles and Ellipse
 
Dda line algorithm presentatiion
Dda line algorithm presentatiionDda line algorithm presentatiion
Dda line algorithm presentatiion
 
Line Drawing Algorithms - Computer Graphics - Notes
Line Drawing Algorithms - Computer Graphics - NotesLine Drawing Algorithms - Computer Graphics - Notes
Line Drawing Algorithms - Computer Graphics - Notes
 
Circle drawing algo.
Circle drawing algo.Circle drawing algo.
Circle drawing algo.
 
Frame buffer
Frame bufferFrame buffer
Frame buffer
 
Computer graphics
Computer graphicsComputer graphics
Computer graphics
 
DDA algorithm
DDA algorithmDDA algorithm
DDA algorithm
 
Filtering in frequency domain
Filtering in frequency domainFiltering in frequency domain
Filtering in frequency domain
 
Bresenham's line algorithm
Bresenham's line algorithmBresenham's line algorithm
Bresenham's line algorithm
 
Mid-Point Cirle Drawing Algorithm
Mid-Point Cirle Drawing AlgorithmMid-Point Cirle Drawing Algorithm
Mid-Point Cirle Drawing Algorithm
 
Scan line method
Scan line methodScan line method
Scan line method
 
Anti- aliasing computer graphics
Anti- aliasing computer graphicsAnti- aliasing computer graphics
Anti- aliasing computer graphics
 
fractals
fractalsfractals
fractals
 
Random scan displays and raster scan displays
Random scan displays and raster scan displaysRandom scan displays and raster scan displays
Random scan displays and raster scan displays
 

Similar to Bressenham’s Midpoint Circle Drawing Algorithm

mid point algorithm.pdf
mid point algorithm.pdfmid point algorithm.pdf
mid point algorithm.pdfMehulMunshi3
 
Lines and curves algorithms
Lines and curves algorithmsLines and curves algorithms
Lines and curves algorithmsMohammad Sadiq
 
Computer_Graphics_circle_drawing_techniq.ppt
Computer_Graphics_circle_drawing_techniq.pptComputer_Graphics_circle_drawing_techniq.ppt
Computer_Graphics_circle_drawing_techniq.pptAliZaib71
 
Lec05 circle ellipse
Lec05 circle ellipseLec05 circle ellipse
Lec05 circle ellipseMaaz Rizwan
 
Circle algorithm
Circle algorithmCircle algorithm
Circle algorithmPooja Dixit
 
Geometry (Grid & section formula)
Geometry (Grid & section formula)Geometry (Grid & section formula)
Geometry (Grid & section formula)itutor
 
Coordinategeometry1 1
Coordinategeometry1 1Coordinategeometry1 1
Coordinategeometry1 1TGTMATH
 
Coordinategeometry1 1
Coordinategeometry1 1Coordinategeometry1 1
Coordinategeometry1 1TGTMATH
 
Open GL T0074 56 sm4
Open GL T0074 56 sm4Open GL T0074 56 sm4
Open GL T0074 56 sm4Roziq Bahtiar
 
Comuter graphics bresenhams circle drawing algorithm
Comuter graphics bresenhams circle drawing algorithmComuter graphics bresenhams circle drawing algorithm
Comuter graphics bresenhams circle drawing algorithmRachana Marathe
 
Kelompok 1
Kelompok 1Kelompok 1
Kelompok 1teddy
 

Similar to Bressenham’s Midpoint Circle Drawing Algorithm (20)

mid point algorithm.pdf
mid point algorithm.pdfmid point algorithm.pdf
mid point algorithm.pdf
 
Lines and curves algorithms
Lines and curves algorithmsLines and curves algorithms
Lines and curves algorithms
 
Computer_Graphics_circle_drawing_techniq.ppt
Computer_Graphics_circle_drawing_techniq.pptComputer_Graphics_circle_drawing_techniq.ppt
Computer_Graphics_circle_drawing_techniq.ppt
 
Lec05 circle ellipse
Lec05 circle ellipseLec05 circle ellipse
Lec05 circle ellipse
 
10994479.ppt
10994479.ppt10994479.ppt
10994479.ppt
 
Computer Graphics - lines, Circles and ellipse
Computer Graphics - lines, Circles and ellipseComputer Graphics - lines, Circles and ellipse
Computer Graphics - lines, Circles and ellipse
 
2.circle
2.circle2.circle
2.circle
 
Circle algorithm
Circle algorithmCircle algorithm
Circle algorithm
 
Algorithm.pptx
Algorithm.pptxAlgorithm.pptx
Algorithm.pptx
 
Geometry (Grid & section formula)
Geometry (Grid & section formula)Geometry (Grid & section formula)
Geometry (Grid & section formula)
 
1513 circles
1513 circles1513 circles
1513 circles
 
Geometry Transformation
Geometry TransformationGeometry Transformation
Geometry Transformation
 
Circle
CircleCircle
Circle
 
Quadratic equation.pptx
Quadratic equation.pptxQuadratic equation.pptx
Quadratic equation.pptx
 
Coordinategeometry1 1
Coordinategeometry1 1Coordinategeometry1 1
Coordinategeometry1 1
 
Coordinategeometry1 1
Coordinategeometry1 1Coordinategeometry1 1
Coordinategeometry1 1
 
Open GL T0074 56 sm4
Open GL T0074 56 sm4Open GL T0074 56 sm4
Open GL T0074 56 sm4
 
Dda algo notes
Dda algo notesDda algo notes
Dda algo notes
 
Comuter graphics bresenhams circle drawing algorithm
Comuter graphics bresenhams circle drawing algorithmComuter graphics bresenhams circle drawing algorithm
Comuter graphics bresenhams circle drawing algorithm
 
Kelompok 1
Kelompok 1Kelompok 1
Kelompok 1
 

Recently uploaded

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
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
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
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxk795866
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...Chandu841456
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxKartikeyaDwivedi3
 
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
 
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
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
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
 
An introduction to Semiconductor and its types.pptx
An introduction to Semiconductor and its types.pptxAn introduction to Semiconductor and its types.pptx
An introduction to Semiconductor and its types.pptxPurva Nikam
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptSAURABHKUMAR892774
 
Correctly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleCorrectly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleAlluxio, Inc.
 
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
 
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
 
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
 
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncWhy does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncssuser2ae721
 

Recently uploaded (20)

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
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
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...
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptx
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptx
 
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
 
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
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
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
 
An introduction to Semiconductor and its types.pptx
An introduction to Semiconductor and its types.pptxAn introduction to Semiconductor and its types.pptx
An introduction to Semiconductor and its types.pptx
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.ppt
 
Correctly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleCorrectly Loading Incremental Data at Scale
Correctly Loading Incremental Data at Scale
 
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
 
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
 
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
 
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncWhy does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
 

Bressenham’s Midpoint Circle Drawing Algorithm

  • 2. WHAT IS A CIRCLE? • A circle is the set of all points in a plane that are at a given distance from a given point, the centre. • Equivalently it is the curve traced out by a point that moves so that its distance from a given point is constant. • A circle may also be defined as a special ellipse in which the two foci are coincident and the eccentricity is 0.
  • 3.
  • 4. GENERATING CIRCLES Circle equation : f(x,y) = x2 + y2 – r2 Any point on the circumference of the circle will satisfy the above equation. Hence : >0  Point is outside the boundary of the circle f(x,y) =0  Point is on the boundary of the circle <=  Point is inside the boundary of the circle
  • 5. FIRST OCTANT • For a pixel at (xk, yk) the next pixel (xk +1, yk) or at (xk+1, yk–1) is closer to the circle. • The pixel point Pk for a corresponding point on the circle is given as: Pk = f(xk + 1, yk – ½) = (xk + 1)2 + yk - ½)2 – r2 • The next pixel point Pk+1 is given as: Pk+1 = f(xk+1 + 1, yk+1 - ½) = [(xk + 1) + 1]2 + (yk+1 - ½ )2 – r2 (xk +1, yk) (xk+1, yk–1)
  • 6. Expanding Pk and Pk+1 and subtracting them, the eq. obtained is: Pk+1 = Pk + 2(xk+1) + (y2 k+1 – y2 k) – (yk+1 – yk) + 1 (where the next Y – coordinate (yk+1) is either yk or yk-1 depending on the sign of Pk.) Since xk+1 denotes the next point along the X – axis (going rightwards) xk+1 = xk + 1  2(xk+1) = 2xk + 2 Since yk+1 denotes the next point along the Y – axis (going downwards) yk+1 = yk - 1  2(yk+1) = 2yk - 2
  • 7. We’ve have to begin somewhere. So let the starting position be (x0,y0) = (0, r) Substituting these values in the circle equation, P0 = f(1, r – ½) = 𝟓 𝟒 - r Since r is a integer, neglecting the small value of ¼, we have P0 = 1 - r (0, r) (0, 0)
  • 8. BRESSENHAM’S ALGORITHM 1. Input radius r and centre of the circle (xc, yc), and obtain the first point on the circumference of a circle centred on the origin as (x0, y0) = (0, r) 2. Calculate the initial value of the decision parameter as P0 = 1 – r where r is the radius of the circle
  • 9. 3. At each xk position, starting at k= 0, perform the following test: If (Pk < 0), then the NEXT POINT along the circle centred on (0, 0) is (xk+1, yk) and Pk+1 = Pk + 2xk+1 +1  Pk+1 = Pk + 2xk + 3 Otherwise, the NEXT POINT along the circle is (xk+1, yk–1) and Pk+1 = Pk + 2xk+1 + 1 – 2yk+1  Pk+1 = Pk + 2xk – 2yk + 5 2xk+1 = 2xk + 2 2yk+1 = 2yk – 2
  • 10. 4. Determine the Symmetry Points on the other 7 Octants 5. Move each calculated pixel position (x,y) onto the circular path centered at (xc,yc) and plot the coordinate values as x = x + xc and y = y + yc 6. Repeat steps 3 to 5 until x >= y
  • 11. FOR EXAMPLE Consider a circle that has to be drawn with its center at (0, 0) and a radius of 10: Initial point on the circumference of the circle is (0, r) = (0 ,10) Initial pixel P0 = 1 – r = 1 – 10 = -9 Therefore, x = 0, y = 10, 2x = 0, 2y = 20, P0 = -9 Applying Bressenham’s Algorithm, we tabulate the data into a table
  • 12. Pk Formula Pk Xk Yk Initial Values -9 0 10 <0  -9 + 2(0) + 3 = -6 1 10 <0  -6 + 2(1) + 3 = -1 2 10 <0  -1 + 2(2) + 3 = 6 3 10 >0  6 + 2(3) -2(10) + 5 = -3 4 9 <0  -3 + 2(4) + 3 = 8 5 9 >0  8 + 2(5) – 2(9) + 5 = 5 6 8 >0  5 + 2(6) – 2(8) + 5 = 6 7 7 >0  6 + 2(7) – 2(7) + 5 = 11 8 6 REMEMBER: xk+1 and yk+1 is derived based on the sign of Pk REMEMBER: Pk+1 derived from Pk, xk and yk First calculate xk+1 and yk+1 values from Pk and then Pk+1 from Pk, xk, yk
  • 13. 11 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 10 11 • This is what the output would look like. • Only the first Octant is shown. • The Remaining Octants can be derived symmetrically by changing the signs.