SlideShare a Scribd company logo
2
Most read
3
Most read
4
Most read
Circle Generation Algorithm
Total Slide (14)
Circle Generation Algorithm
• Circle Generation is a tricky task for computer because
we have to choose pixels along a circular path.
• Selection of right pixel for illumination requires more
computation time as compare to Line drawing
algorithm.
• Selection of appropriate pixels is based on decision
parameter which is same as line drawing algorithm but
computation is different.
• Two algorithm for Circle generation are:
• Breshenham’s Circle Generation Algorithm
• Mid Point Circle generation Algorithm.
Circle generation algorithm
Breshenham’s Circle Generation Algorithm
1. Set x=0; y=10 here y contains value for radius of circle
2. p=3-(2*r) calculate first decision parameter which calculate which pixel will glow on
the circumference of the circle.
3. Repeat setp 3 until (i<y), set always set i=x initially
4. If p<0
calculate x=x+1, Y=Y and next decision parameter by p=p+4*x+6;
Otherwise
Calculate y=y-1 and x=x+1;
Calculate next decision parameter by p=p+4*x-4*y+10;
calculte points for all octants of circle by using and paint corresponding points with
color
putpixel(xc+x,yc-y,4); putpixel(xc-x,yc-y,4);
putpixel(xc+x,yc+y,4); putpixel(xc-x,yc+y,4);
putpixel(xc+y,yc-x,4); putpixel(xc-y,yc-x,4);
putpixel(xc+y,yc+x,4); putpixel(xc-y,yc+x,4);
5. Stop algorithm when (i>y) or (i==y)
Code section from circle Program
• x=0;y=100;
• p=3-(2*r);
• for(int i=0;i<y;i++)
• {
• if(p<0)
• { x=x+1; p=p+4*x+6; }
• else
{ y=y-1; x=x+1; p=p+4*x-4*y+10; }
• putpixel(xc+x,yc-y,4); putpixel(xc-x,yc-y,4);
• putpixel(xc+x,yc+y,4); putpixel(xc-x,yc+y,4);
• putpixel(xc+y,yc-x,4); putpixel(xc-y,yc-x,4);
• putpixel(xc+y,yc+x,4); putpixel(xc-y,yc+x,4);
• delay(40);
• }
Numerical based on Breshenham’s Circle generation algorithm
(x,y) (y,x) (-x,y) (-y,x) (-x,-y) (-y,-x) (x,-y) (y,-x) (p<0)
P=p+4x+6; x=x+1
(p>=0)
P=p+4(x-y)+10
x=x+1, y=y-1
(0,10) (10,0) (-0,10) (-10,0) (-0,-10) (-10,-0) (0,-10) (10,-0) P=-17
(1,10) (10,1) (-1,10) (-10,1) (-1,-10) (-10,-1) (1,-10) (10,-1) P= -7
(2,10) (10,2) (-2,10) (-10,2) (-2,-10) (-10,-2) (2,-10) (10,-2) P=7
(3,9) (9,3) (-3,9) (-9,3) (-3,-9) (-9,-3) (3,-9) (9,-3) P=-7
(4,9) (9,4) (-4,9) (-9,4) (-4,-9) (-9,-4) (4,-9) (9,-4) P=15
(5,8) (8,5) (-5,8) (-8,5) (-5,-8) (-8,-5) (5,-8) (8,-5) P=13
(6,7) (7,6) (-6,7) (-7,6) (-6,-7) (-7,-6) (6,-7) (7-6) P=19
(7,6) (6,7) (-7,6) (-6,7) (-7,-6) (-6,-7) (7,-6) (6-7) don’t Draw These Points
Because (x>y). Stop
Algorithm when X>=Y.
Generate Circle when radius is 10 using breshenham’s circle generation algorithm
Let Circle radius is 10 X=0 and y=r or y=10 P=3-2*10; p=-17
Question
• Generate Circle using breshenham’s Circle generation algorithm when
radius is 5.
(x,y) (y,x) (-x,y) (-y,x) (-x,-y) (-y,-x) (x,-y) (y,-x) (p<0)
P=p+4x+6; x=x+1
(p>=0)
P=p+4(x-y)+10
x=x+1, y=y-1
(0,5) (5,0) (-0,5) (-5,0) (-0,-5) (-5-0) (0,-5) (5,-0) P=--7
(1,5) (5,1) (-1,5) (-5,1) (-1,-5) (-5,-1) (1,-5) (5,-1) P= 3
(2,4) (4,2) (-2,4) (-4,2) (-2,-4) (-4,-2) (2,-4) (4,-2) P=5
(3,3) (3,3) (-3,3) (-3,3) (-3,-3) (-3,-3) (3,-3) (3,-3) Algorithm will stop when
x==y or x>y (don’t
calculate next points )
Draw all the calculated
points
THANK YOU!!

More Related Content

PPTX
File Handling Python
Akhil Kaushik
 
PPTX
GD&T - PPT
Sree Lakshmy
 
PPTX
DFMA design for manufacturing and assembly
Automated Manufacturing Engineering Dept.
 
PDF
A* Search Algorithm
vikas dhakane
 
PPT
Internet ppt
sushruth kamarushi
 
PPTX
Output primitives in Computer Graphics
Kamal Acharya
 
PPTX
Shadow pricing
Suzana Vaidya
 
PDF
Basic Photography.pdf
DIWAKARM24
 
File Handling Python
Akhil Kaushik
 
GD&T - PPT
Sree Lakshmy
 
DFMA design for manufacturing and assembly
Automated Manufacturing Engineering Dept.
 
A* Search Algorithm
vikas dhakane
 
Internet ppt
sushruth kamarushi
 
Output primitives in Computer Graphics
Kamal Acharya
 
Shadow pricing
Suzana Vaidya
 
Basic Photography.pdf
DIWAKARM24
 

What's hot (20)

PPTX
Mid point circle algorithm
Mani Kanth
 
PPTX
Raster scan systems with video controller and display processor
hemanth kumar
 
PPTX
Cyrus beck line clipping algorithm
Pooja Dixit
 
PPT
Two dimensional geometric transformations
Mohammad Sadiq
 
PDF
Computer Graphics - Output Primitive
Rupesh Mishra
 
PPTX
Depth Buffer Method
Ummiya Mohammedi
 
PPTX
Composite transformation
Pooja Dixit
 
PPTX
Computer graphics basic transformation
Selvakumar Gna
 
PPTX
Clipping
AMIT VIRAMGAMI
 
PPTX
Computer graphics LINE DRAWING algorithm.pptx
R S Anu Prabha
 
PPTX
Frame buffer
Aparna Joshi
 
PPTX
Clipping in Computer Graphics
Laxman Puri
 
PPTX
Bresenham circle
Taher Barodawala
 
PPT
Visible surface detection in computer graphic
anku2266
 
PPT
Line drawing algo.
Mohd Arif
 
PPTX
BRESENHAM’S LINE DRAWING ALGORITHM
St Mary's College,Thrissur,Kerala
 
PPTX
Bresenham's line drawing algorithm
nehrurevathy
 
PPTX
Hidden surface removal
Punyajoy Saha
 
PPT
Window to viewport transformation
Ankit Garg
 
PPT
2 d geometric transformations
Mohd Arif
 
Mid point circle algorithm
Mani Kanth
 
Raster scan systems with video controller and display processor
hemanth kumar
 
Cyrus beck line clipping algorithm
Pooja Dixit
 
Two dimensional geometric transformations
Mohammad Sadiq
 
Computer Graphics - Output Primitive
Rupesh Mishra
 
Depth Buffer Method
Ummiya Mohammedi
 
Composite transformation
Pooja Dixit
 
Computer graphics basic transformation
Selvakumar Gna
 
Clipping
AMIT VIRAMGAMI
 
Computer graphics LINE DRAWING algorithm.pptx
R S Anu Prabha
 
Frame buffer
Aparna Joshi
 
Clipping in Computer Graphics
Laxman Puri
 
Bresenham circle
Taher Barodawala
 
Visible surface detection in computer graphic
anku2266
 
Line drawing algo.
Mohd Arif
 
BRESENHAM’S LINE DRAWING ALGORITHM
St Mary's College,Thrissur,Kerala
 
Bresenham's line drawing algorithm
nehrurevathy
 
Hidden surface removal
Punyajoy Saha
 
Window to viewport transformation
Ankit Garg
 
2 d geometric transformations
Mohd Arif
 
Ad

Similar to Circle generation algorithm (20)

PPTX
L-6 (Circle Drawing Algorithm Computer graphics).pptx
JatinSareen6
 
PPT
Unit 3
Siddhant Goyal
 
PPTX
Chapter 3 - Part 1 [Autosaved].pptx
Kokebe2
 
PPT
2.circle
SakshiNailwal
 
PPTX
Lec05 circle ellipse
Maaz Rizwan
 
PPTX
Computer graphics
Nanhen Verma
 
PDF
Computer graphics 2
Prabin Gautam
 
PPTX
CG-Lecture3.pptx
lakshitasarika2014
 
PDF
Unit-2 raster scan graphics,line,circle and polygon algorithms
Amol Gaikwad
 
PDF
module 1.pdf
KimTaehyung188352
 
PPT
2.Line,circle drawing.ppt line circlw drawing algorith
SwatiChauhan63735
 
PPT
Output Primitives in Computer Graphics and Multimedia
saranyan75
 
PPT
Computer Graphics and Multimedia Output primitives
saranyan75
 
PPTX
PPT_14.pptx
SanandMishra
 
PDF
mid point algorithm.pdf
MehulMunshi3
 
PPT
Cs580
Chellamuthu K
 
PPT
10994479.ppt
ALIZAIB KHAN
 
PPTX
7. Bresenharms Circle Generation Algo_c8503330f911dd9ec76af8508bc0728d.pptx
ghosharkoprabho
 
PPT
Graphics6 bresenham circlesandpolygons
Ketan Jani
 
PPT
Graphics6 bresenham circlesandpolygons
Thirunavukarasu Mani
 
L-6 (Circle Drawing Algorithm Computer graphics).pptx
JatinSareen6
 
Chapter 3 - Part 1 [Autosaved].pptx
Kokebe2
 
2.circle
SakshiNailwal
 
Lec05 circle ellipse
Maaz Rizwan
 
Computer graphics
Nanhen Verma
 
Computer graphics 2
Prabin Gautam
 
CG-Lecture3.pptx
lakshitasarika2014
 
Unit-2 raster scan graphics,line,circle and polygon algorithms
Amol Gaikwad
 
module 1.pdf
KimTaehyung188352
 
2.Line,circle drawing.ppt line circlw drawing algorith
SwatiChauhan63735
 
Output Primitives in Computer Graphics and Multimedia
saranyan75
 
Computer Graphics and Multimedia Output primitives
saranyan75
 
PPT_14.pptx
SanandMishra
 
mid point algorithm.pdf
MehulMunshi3
 
10994479.ppt
ALIZAIB KHAN
 
7. Bresenharms Circle Generation Algo_c8503330f911dd9ec76af8508bc0728d.pptx
ghosharkoprabho
 
Graphics6 bresenham circlesandpolygons
Ketan Jani
 
Graphics6 bresenham circlesandpolygons
Thirunavukarasu Mani
 
Ad

More from Ankit Garg (19)

PPT
Introduction to computer graphics part 2
Ankit Garg
 
PPT
Introduction to computer graphics part 1
Ankit Garg
 
DOCX
Curve clipping
Ankit Garg
 
PPT
Unit 1
Ankit Garg
 
PPT
Projection ppt
Ankit Garg
 
PPT
Polygon filling
Ankit Garg
 
PPT
Polygon clipping
Ankit Garg
 
PPTX
Numerical unit 1
Ankit Garg
 
PPT
Line drawing algorithm and antialiasing techniques
Ankit Garg
 
PPT
Line clipping
Ankit Garg
 
PPTX
Hidden surface removal
Ankit Garg
 
PPTX
Graphics software standards
Ankit Garg
 
PPTX
Fractal introduction and applications modified version
Ankit Garg
 
PPTX
Digital image processing &amp; computer graphics
Ankit Garg
 
PPTX
Concept of basic illumination model
Ankit Garg
 
PPT
Character generation
Ankit Garg
 
PPT
Applications of cg
Ankit Garg
 
PPT
2 d transformation
Ankit Garg
 
PPT
3 d transformations
Ankit Garg
 
Introduction to computer graphics part 2
Ankit Garg
 
Introduction to computer graphics part 1
Ankit Garg
 
Curve clipping
Ankit Garg
 
Unit 1
Ankit Garg
 
Projection ppt
Ankit Garg
 
Polygon filling
Ankit Garg
 
Polygon clipping
Ankit Garg
 
Numerical unit 1
Ankit Garg
 
Line drawing algorithm and antialiasing techniques
Ankit Garg
 
Line clipping
Ankit Garg
 
Hidden surface removal
Ankit Garg
 
Graphics software standards
Ankit Garg
 
Fractal introduction and applications modified version
Ankit Garg
 
Digital image processing &amp; computer graphics
Ankit Garg
 
Concept of basic illumination model
Ankit Garg
 
Character generation
Ankit Garg
 
Applications of cg
Ankit Garg
 
2 d transformation
Ankit Garg
 
3 d transformations
Ankit Garg
 

Recently uploaded (20)

PPTX
22PCOAM21 Data Quality Session 3 Data Quality.pptx
Guru Nanak Technical Institutions
 
PDF
Software Testing Tools - names and explanation
shruti533256
 
PPTX
Module2 Data Base Design- ER and NF.pptx
gomathisankariv2
 
PDF
Introduction to Ship Engine Room Systems.pdf
Mahmoud Moghtaderi
 
PPTX
Civil Engineering Practices_BY Sh.JP Mishra 23.09.pptx
bineetmishra1990
 
PDF
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 
PPT
Ppt for engineering students application on field effect
lakshmi.ec
 
DOCX
SAR - EEEfdfdsdasdsdasdasdasdasdasdasdasda.docx
Kanimozhi676285
 
PDF
LEAP-1B presedntation xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
hatem173148
 
PDF
Unit I Part II.pdf : Security Fundamentals
Dr. Madhuri Jawale
 
PPTX
Information Retrieval and Extraction - Module 7
premSankar19
 
PDF
July 2025: Top 10 Read Articles Advanced Information Technology
ijait
 
PPTX
database slide on modern techniques for optimizing database queries.pptx
aky52024
 
PDF
Queuing formulas to evaluate throughputs and servers
gptshubham
 
PDF
Traditional Exams vs Continuous Assessment in Boarding Schools.pdf
The Asian School
 
PDF
flutter Launcher Icons, Splash Screens & Fonts
Ahmed Mohamed
 
PPTX
MSME 4.0 Template idea hackathon pdf to understand
alaudeenaarish
 
PDF
Chad Ayach - A Versatile Aerospace Professional
Chad Ayach
 
PDF
dse_final_merit_2025_26 gtgfffffcjjjuuyy
rushabhjain127
 
PDF
2010_Book_EnvironmentalBioengineering (1).pdf
EmilianoRodriguezTll
 
22PCOAM21 Data Quality Session 3 Data Quality.pptx
Guru Nanak Technical Institutions
 
Software Testing Tools - names and explanation
shruti533256
 
Module2 Data Base Design- ER and NF.pptx
gomathisankariv2
 
Introduction to Ship Engine Room Systems.pdf
Mahmoud Moghtaderi
 
Civil Engineering Practices_BY Sh.JP Mishra 23.09.pptx
bineetmishra1990
 
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 
Ppt for engineering students application on field effect
lakshmi.ec
 
SAR - EEEfdfdsdasdsdasdasdasdasdasdasdasda.docx
Kanimozhi676285
 
LEAP-1B presedntation xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
hatem173148
 
Unit I Part II.pdf : Security Fundamentals
Dr. Madhuri Jawale
 
Information Retrieval and Extraction - Module 7
premSankar19
 
July 2025: Top 10 Read Articles Advanced Information Technology
ijait
 
database slide on modern techniques for optimizing database queries.pptx
aky52024
 
Queuing formulas to evaluate throughputs and servers
gptshubham
 
Traditional Exams vs Continuous Assessment in Boarding Schools.pdf
The Asian School
 
flutter Launcher Icons, Splash Screens & Fonts
Ahmed Mohamed
 
MSME 4.0 Template idea hackathon pdf to understand
alaudeenaarish
 
Chad Ayach - A Versatile Aerospace Professional
Chad Ayach
 
dse_final_merit_2025_26 gtgfffffcjjjuuyy
rushabhjain127
 
2010_Book_EnvironmentalBioengineering (1).pdf
EmilianoRodriguezTll
 

Circle generation algorithm

  • 2. Circle Generation Algorithm • Circle Generation is a tricky task for computer because we have to choose pixels along a circular path. • Selection of right pixel for illumination requires more computation time as compare to Line drawing algorithm. • Selection of appropriate pixels is based on decision parameter which is same as line drawing algorithm but computation is different. • Two algorithm for Circle generation are: • Breshenham’s Circle Generation Algorithm • Mid Point Circle generation Algorithm.
  • 4. Breshenham’s Circle Generation Algorithm 1. Set x=0; y=10 here y contains value for radius of circle 2. p=3-(2*r) calculate first decision parameter which calculate which pixel will glow on the circumference of the circle. 3. Repeat setp 3 until (i<y), set always set i=x initially 4. If p<0 calculate x=x+1, Y=Y and next decision parameter by p=p+4*x+6; Otherwise Calculate y=y-1 and x=x+1; Calculate next decision parameter by p=p+4*x-4*y+10; calculte points for all octants of circle by using and paint corresponding points with color putpixel(xc+x,yc-y,4); putpixel(xc-x,yc-y,4); putpixel(xc+x,yc+y,4); putpixel(xc-x,yc+y,4); putpixel(xc+y,yc-x,4); putpixel(xc-y,yc-x,4); putpixel(xc+y,yc+x,4); putpixel(xc-y,yc+x,4); 5. Stop algorithm when (i>y) or (i==y)
  • 5. Code section from circle Program • x=0;y=100; • p=3-(2*r); • for(int i=0;i<y;i++) • { • if(p<0) • { x=x+1; p=p+4*x+6; } • else { y=y-1; x=x+1; p=p+4*x-4*y+10; } • putpixel(xc+x,yc-y,4); putpixel(xc-x,yc-y,4); • putpixel(xc+x,yc+y,4); putpixel(xc-x,yc+y,4); • putpixel(xc+y,yc-x,4); putpixel(xc-y,yc-x,4); • putpixel(xc+y,yc+x,4); putpixel(xc-y,yc+x,4); • delay(40); • }
  • 6. Numerical based on Breshenham’s Circle generation algorithm (x,y) (y,x) (-x,y) (-y,x) (-x,-y) (-y,-x) (x,-y) (y,-x) (p<0) P=p+4x+6; x=x+1 (p>=0) P=p+4(x-y)+10 x=x+1, y=y-1 (0,10) (10,0) (-0,10) (-10,0) (-0,-10) (-10,-0) (0,-10) (10,-0) P=-17 (1,10) (10,1) (-1,10) (-10,1) (-1,-10) (-10,-1) (1,-10) (10,-1) P= -7 (2,10) (10,2) (-2,10) (-10,2) (-2,-10) (-10,-2) (2,-10) (10,-2) P=7 (3,9) (9,3) (-3,9) (-9,3) (-3,-9) (-9,-3) (3,-9) (9,-3) P=-7 (4,9) (9,4) (-4,9) (-9,4) (-4,-9) (-9,-4) (4,-9) (9,-4) P=15 (5,8) (8,5) (-5,8) (-8,5) (-5,-8) (-8,-5) (5,-8) (8,-5) P=13 (6,7) (7,6) (-6,7) (-7,6) (-6,-7) (-7,-6) (6,-7) (7-6) P=19 (7,6) (6,7) (-7,6) (-6,7) (-7,-6) (-6,-7) (7,-6) (6-7) don’t Draw These Points Because (x>y). Stop Algorithm when X>=Y. Generate Circle when radius is 10 using breshenham’s circle generation algorithm Let Circle radius is 10 X=0 and y=r or y=10 P=3-2*10; p=-17
  • 7. Question • Generate Circle using breshenham’s Circle generation algorithm when radius is 5. (x,y) (y,x) (-x,y) (-y,x) (-x,-y) (-y,-x) (x,-y) (y,-x) (p<0) P=p+4x+6; x=x+1 (p>=0) P=p+4(x-y)+10 x=x+1, y=y-1 (0,5) (5,0) (-0,5) (-5,0) (-0,-5) (-5-0) (0,-5) (5,-0) P=--7 (1,5) (5,1) (-1,5) (-5,1) (-1,-5) (-5,-1) (1,-5) (5,-1) P= 3 (2,4) (4,2) (-2,4) (-4,2) (-2,-4) (-4,-2) (2,-4) (4,-2) P=5 (3,3) (3,3) (-3,3) (-3,3) (-3,-3) (-3,-3) (3,-3) (3,-3) Algorithm will stop when x==y or x>y (don’t calculate next points ) Draw all the calculated points