SlideShare una empresa de Scribd logo
1 de 16
Unit 1
Basic of computer graphics
By: Medhavi Pandey
Outline
⮚Circle Generating Algorithms
▪ Mid Point Circle drawing algorithm.
▪ Numerical Practice
Mid –Point Circle Algorithm
• Given the center point and radius of circle, Mid Point Circle Drawing
Algorithm attempts to generate the points of one octant.
• The points for other octants are generated using the eight symmetry
property.
Mid –Point Circle Algorithm
• Procedure-
• Given-
• Centre point of Circle = (X0, Y0)
• Radius of Circle = R
• Step-01:
• Assign the starting point coordinates (X0, Y0) as-
• X0 = 0
• Y0 = R
Mid –Point Circle Algorithm
• Step-02:
• Calculate the value of initial decision parameter P0 as-
• P0 = 1 – R
• Step-03:
• Suppose the current point is (Xk, Yk) and the next point is (Xk+1, Yk+1).
• Find the next point of the first octant depending on the value of
decision parameter Pk.
• Follow the below two cases-
Algorithm
• Step1: input radius r, center (xc ,yc) and obtain the first point on the
circumference of a circle centered on an origin ( (x,y) =(0,r) )
• Put x =0, y =r
• Calculate initial value decision parameter as p=1-r
• Step2: Repeat steps while x ≤ y
Plot (x, y)
If (p<0)
Then set x=x+1
Y=y
P = P + 2x + 3
• Else
P = P + 2(x-y)+1
y =y - 1
x =x+1
• To find the points for other seven octants, follow the eight symmetry
property of circle.
Problem: Given the centre point coordinates (0, 0) and radius as 10,
generate all the points to form a circle.
• Solution: Given-
• Centre Coordinates of Circle (X0, Y0) = (0, 0)
• Radius of Circle = 10
• Step-01:
• Assign the starting point coordinates (X0, Y0) as-
• X0 = 0
• Y0 = R = 10
• Calculate the value of initial decision parameter P0 as-
• P0 = 1 – R
• P0 = 1 – 10
• P0 = -9
• As Pinitial < 0, so case-01 is satisfied.
• Thus,
• Xk+1 = Xk + 1 = 0 + 1 = 1
• Yk+1 = Yk = 10
• Pk+1 = Pk + 2 * Xk+1 + 3 = -9 + (2 x 1) + 1 = -6
Pk Pk+1 (Xk+1, Yk+1)
(0, 10)
-9 -6 (1, 10)
-6 -1 (2, 10)
-1 6 (3, 10)
6 -3 (4, 9)
-3 8 (5, 9)
8 5 (6, 8)
• Algorithm calculates all the points of octant-1 and terminates.
• Now, the points of octant-2 are obtained using the mirror effect by
swapping X and Y coordinates.
Octant-1 Points
Octant-2
Points
(0, 10) (8, 6)
(1, 10) (9, 5)
(2, 10) (9, 4)
(3, 10) (10, 3)
(4, 9) (10, 2)
(5, 9) (10, 1)
(6, 8) (10, 0)
Now, the points for rest of the part are generated by following the signs of other
quadrants. The other points can also be generated by calculating each octant separately.
Advantages of Mid Point Circle Drawing
Algorithm
• It is a powerful and efficient algorithm.
• The entire algorithm is based on the simple equation of circle X2 +
Y2 = R2.
• It is easy to implement from the programmer’s perspective.
• This algorithm is used to generate curves on raster displays.
Disadvantages of Mid Point Circle Drawing
Algorithm
• Accuracy of the generating points is an issue in this algorithm.
• The circle generated by this algorithm is not smooth.
• This algorithm is time consuming.
Difference Between Midpoint Circle
Algorithm And Bresenham's Circle
Algorithm
Midpoint Circle Algorithm Bresenham's Circle Algorithm
This algorithm is used to generate curves on raster
displays. It is quite Simple to implement.
Bresenham's circle algorithm is simply an optimized
version of the Midpoint circle algorithm. So, it needs
very less time and requires less memory consuming
Mid Point may still needs floating point. Although it
also avoids square root or trigonometric calculation by
adopting integer operation only.
It uses just integer arithmetics.
Accuracy of the generating points is an issue in this
algorithm.
Algorithm is accurate and efficient as it avoids using
round function or floating point calculations.
THANK YOU

Más contenido relacionado

Similar a PPT_14.pptx

Computer_Graphics_circle_drawing_techniq.ppt
Computer_Graphics_circle_drawing_techniq.pptComputer_Graphics_circle_drawing_techniq.ppt
Computer_Graphics_circle_drawing_techniq.pptAliZaib71
 
Output primitives in Computer Graphics
Output primitives in Computer GraphicsOutput primitives in Computer Graphics
Output primitives in Computer GraphicsKamal Acharya
 
Graphics6 bresenham circlesandpolygons
Graphics6 bresenham circlesandpolygonsGraphics6 bresenham circlesandpolygons
Graphics6 bresenham circlesandpolygonsThirunavukarasu Mani
 
Graphics6 bresenham circlesandpolygons
Graphics6 bresenham circlesandpolygonsGraphics6 bresenham circlesandpolygons
Graphics6 bresenham circlesandpolygonsKetan Jani
 
Bressenham’s Midpoint Circle Drawing Algorithm
Bressenham’s Midpoint Circle Drawing AlgorithmBressenham’s Midpoint Circle Drawing Algorithm
Bressenham’s Midpoint Circle Drawing AlgorithmMrinmoy Dalal
 
Output Primitives in Computer Graphics and Multimedia
Output Primitives in Computer Graphics and MultimediaOutput Primitives in Computer Graphics and Multimedia
Output Primitives in Computer Graphics and Multimediasaranyan75
 
Computer Graphics and Multimedia Output primitives
Computer Graphics and Multimedia Output primitivesComputer Graphics and Multimedia Output primitives
Computer Graphics and Multimedia Output primitivessaranyan75
 
Chapter 3 - Part 1 [Autosaved].pptx
Chapter 3 - Part 1 [Autosaved].pptxChapter 3 - Part 1 [Autosaved].pptx
Chapter 3 - Part 1 [Autosaved].pptxKokebe2
 
"Fundamentals of Monocular SLAM," a Presentation from Cadence
"Fundamentals of Monocular SLAM," a Presentation from Cadence"Fundamentals of Monocular SLAM," a Presentation from Cadence
"Fundamentals of Monocular SLAM," a Presentation from CadenceEdge AI and Vision Alliance
 
Lab lecture 1 line_algo
Lab lecture 1 line_algoLab lecture 1 line_algo
Lab lecture 1 line_algosimpleok
 
Line drawing algorithm and antialiasing techniques
Line drawing algorithm and antialiasing techniquesLine drawing algorithm and antialiasing techniques
Line drawing algorithm and antialiasing techniquesAnkit Garg
 
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
 
DDA (Digital Differential Analyzer ) Line Drawing Algorithm.pptx
DDA (Digital Differential Analyzer ) Line Drawing Algorithm.pptxDDA (Digital Differential Analyzer ) Line Drawing Algorithm.pptx
DDA (Digital Differential Analyzer ) Line Drawing Algorithm.pptxhasibulhamim1
 
CD504 CGM_Lab Manual_004e08d3838702ed11fc6d03cc82f7be.pdf
CD504 CGM_Lab Manual_004e08d3838702ed11fc6d03cc82f7be.pdfCD504 CGM_Lab Manual_004e08d3838702ed11fc6d03cc82f7be.pdf
CD504 CGM_Lab Manual_004e08d3838702ed11fc6d03cc82f7be.pdfRajJain516913
 

Similar a PPT_14.pptx (20)

Computer_Graphics_circle_drawing_techniq.ppt
Computer_Graphics_circle_drawing_techniq.pptComputer_Graphics_circle_drawing_techniq.ppt
Computer_Graphics_circle_drawing_techniq.ppt
 
Output primitives in Computer Graphics
Output primitives in Computer GraphicsOutput primitives in Computer Graphics
Output primitives in Computer Graphics
 
Graphics6 bresenham circlesandpolygons
Graphics6 bresenham circlesandpolygonsGraphics6 bresenham circlesandpolygons
Graphics6 bresenham circlesandpolygons
 
Graphics6 bresenham circlesandpolygons
Graphics6 bresenham circlesandpolygonsGraphics6 bresenham circlesandpolygons
Graphics6 bresenham circlesandpolygons
 
Computer graphics
Computer graphicsComputer graphics
Computer graphics
 
Computer graphics 2
Computer graphics 2Computer graphics 2
Computer graphics 2
 
Bressenham’s Midpoint Circle Drawing Algorithm
Bressenham’s Midpoint Circle Drawing AlgorithmBressenham’s Midpoint Circle Drawing Algorithm
Bressenham’s Midpoint Circle Drawing Algorithm
 
Output Primitives in Computer Graphics and Multimedia
Output Primitives in Computer Graphics and MultimediaOutput Primitives in Computer Graphics and Multimedia
Output Primitives in Computer Graphics and Multimedia
 
Computer Graphics and Multimedia Output primitives
Computer Graphics and Multimedia Output primitivesComputer Graphics and Multimedia Output primitives
Computer Graphics and Multimedia Output primitives
 
Chapter 3 - Part 1 [Autosaved].pptx
Chapter 3 - Part 1 [Autosaved].pptxChapter 3 - Part 1 [Autosaved].pptx
Chapter 3 - Part 1 [Autosaved].pptx
 
Unit 3
Unit 3Unit 3
Unit 3
 
"Fundamentals of Monocular SLAM," a Presentation from Cadence
"Fundamentals of Monocular SLAM," a Presentation from Cadence"Fundamentals of Monocular SLAM," a Presentation from Cadence
"Fundamentals of Monocular SLAM," a Presentation from Cadence
 
Lec-4_Rendering-1.pdf
Lec-4_Rendering-1.pdfLec-4_Rendering-1.pdf
Lec-4_Rendering-1.pdf
 
Lab lecture 1 line_algo
Lab lecture 1 line_algoLab lecture 1 line_algo
Lab lecture 1 line_algo
 
Line drawing algorithm and antialiasing techniques
Line drawing algorithm and antialiasing techniquesLine drawing algorithm and antialiasing techniques
Line drawing algorithm and antialiasing techniques
 
dld 01-introduction
dld 01-introductiondld 01-introduction
dld 01-introduction
 
bresenham circles and polygons in computer graphics(Computer graphics tutorials)
bresenham circles and polygons in computer graphics(Computer graphics tutorials)bresenham circles and polygons in computer graphics(Computer graphics tutorials)
bresenham circles and polygons in computer graphics(Computer graphics tutorials)
 
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
 
DDA (Digital Differential Analyzer ) Line Drawing Algorithm.pptx
DDA (Digital Differential Analyzer ) Line Drawing Algorithm.pptxDDA (Digital Differential Analyzer ) Line Drawing Algorithm.pptx
DDA (Digital Differential Analyzer ) Line Drawing Algorithm.pptx
 
CD504 CGM_Lab Manual_004e08d3838702ed11fc6d03cc82f7be.pdf
CD504 CGM_Lab Manual_004e08d3838702ed11fc6d03cc82f7be.pdfCD504 CGM_Lab Manual_004e08d3838702ed11fc6d03cc82f7be.pdf
CD504 CGM_Lab Manual_004e08d3838702ed11fc6d03cc82f7be.pdf
 

Más de SanandMishra

Más de SanandMishra (6)

New_title.pptx
New_title.pptxNew_title.pptx
New_title.pptx
 
AI.pptx
AI.pptxAI.pptx
AI.pptx
 
Graphis_AI_Desiggn.pptx
Graphis_AI_Desiggn.pptxGraphis_AI_Desiggn.pptx
Graphis_AI_Desiggn.pptx
 
new ai techniques.pptx
new ai techniques.pptxnew ai techniques.pptx
new ai techniques.pptx
 
PPT_17.pptx
PPT_17.pptxPPT_17.pptx
PPT_17.pptx
 
PPT_1.pptx
PPT_1.pptxPPT_1.pptx
PPT_1.pptx
 

Último

Intramuscular & Intravenous Injection.pptx
Intramuscular & Intravenous Injection.pptxIntramuscular & Intravenous Injection.pptx
Intramuscular & Intravenous Injection.pptxsaranpratha12
 
Gastric Cancer: Сlinical Implementation of Artificial Intelligence, Synergeti...
Gastric Cancer: Сlinical Implementation of Artificial Intelligence, Synergeti...Gastric Cancer: Сlinical Implementation of Artificial Intelligence, Synergeti...
Gastric Cancer: Сlinical Implementation of Artificial Intelligence, Synergeti...Oleg Kshivets
 
👉Chandigarh Call Girl Service📲Niamh 8868886958 📲Book 24hours Now📲👉Sexy Call G...
👉Chandigarh Call Girl Service📲Niamh 8868886958 📲Book 24hours Now📲👉Sexy Call G...👉Chandigarh Call Girl Service📲Niamh 8868886958 📲Book 24hours Now📲👉Sexy Call G...
👉Chandigarh Call Girl Service📲Niamh 8868886958 📲Book 24hours Now📲👉Sexy Call G...Sheetaleventcompany
 
Control of Local Blood Flow: acute and chronic
Control of Local Blood Flow: acute and chronicControl of Local Blood Flow: acute and chronic
Control of Local Blood Flow: acute and chronicMedicoseAcademics
 
Electrocardiogram (ECG) physiological basis .pdf
Electrocardiogram (ECG) physiological basis .pdfElectrocardiogram (ECG) physiological basis .pdf
Electrocardiogram (ECG) physiological basis .pdfMedicoseAcademics
 
Race Course Road } Book Call Girls in Bangalore | Whatsapp No 6378878445 VIP ...
Race Course Road } Book Call Girls in Bangalore | Whatsapp No 6378878445 VIP ...Race Course Road } Book Call Girls in Bangalore | Whatsapp No 6378878445 VIP ...
Race Course Road } Book Call Girls in Bangalore | Whatsapp No 6378878445 VIP ...dishamehta3332
 
💚Call Girls In Amritsar 💯Anvi 📲🔝8725944379🔝Amritsar Call Girl No💰Advance Cash...
💚Call Girls In Amritsar 💯Anvi 📲🔝8725944379🔝Amritsar Call Girl No💰Advance Cash...💚Call Girls In Amritsar 💯Anvi 📲🔝8725944379🔝Amritsar Call Girl No💰Advance Cash...
💚Call Girls In Amritsar 💯Anvi 📲🔝8725944379🔝Amritsar Call Girl No💰Advance Cash...Sheetaleventcompany
 
Cara Menggugurkan Kandungan Dengan Cepat Selesai Dalam 24 Jam Secara Alami Bu...
Cara Menggugurkan Kandungan Dengan Cepat Selesai Dalam 24 Jam Secara Alami Bu...Cara Menggugurkan Kandungan Dengan Cepat Selesai Dalam 24 Jam Secara Alami Bu...
Cara Menggugurkan Kandungan Dengan Cepat Selesai Dalam 24 Jam Secara Alami Bu...Cara Menggugurkan Kandungan 087776558899
 
7 steps How to prevent Thalassemia : Dr Sharda Jain & Vandana Gupta
7 steps How to prevent Thalassemia : Dr Sharda Jain & Vandana Gupta7 steps How to prevent Thalassemia : Dr Sharda Jain & Vandana Gupta
7 steps How to prevent Thalassemia : Dr Sharda Jain & Vandana GuptaLifecare Centre
 
❤️Amritsar Escorts Service☎️9815674956☎️ Call Girl service in Amritsar☎️ Amri...
❤️Amritsar Escorts Service☎️9815674956☎️ Call Girl service in Amritsar☎️ Amri...❤️Amritsar Escorts Service☎️9815674956☎️ Call Girl service in Amritsar☎️ Amri...
❤️Amritsar Escorts Service☎️9815674956☎️ Call Girl service in Amritsar☎️ Amri...Sheetaleventcompany
 
Kolkata Call Girls Shobhabazar 💯Call Us 🔝 8005736733 🔝 💃 Top Class Call Gir...
Kolkata Call Girls Shobhabazar  💯Call Us 🔝 8005736733 🔝 💃  Top Class Call Gir...Kolkata Call Girls Shobhabazar  💯Call Us 🔝 8005736733 🔝 💃  Top Class Call Gir...
Kolkata Call Girls Shobhabazar 💯Call Us 🔝 8005736733 🔝 💃 Top Class Call Gir...Namrata Singh
 
Chandigarh Call Girls Service ❤️🍑 9809698092 👄🫦Independent Escort Service Cha...
Chandigarh Call Girls Service ❤️🍑 9809698092 👄🫦Independent Escort Service Cha...Chandigarh Call Girls Service ❤️🍑 9809698092 👄🫦Independent Escort Service Cha...
Chandigarh Call Girls Service ❤️🍑 9809698092 👄🫦Independent Escort Service Cha...Sheetaleventcompany
 
Dehradun Call Girls Service {8854095900} ❤️VVIP ROCKY Call Girl in Dehradun U...
Dehradun Call Girls Service {8854095900} ❤️VVIP ROCKY Call Girl in Dehradun U...Dehradun Call Girls Service {8854095900} ❤️VVIP ROCKY Call Girl in Dehradun U...
Dehradun Call Girls Service {8854095900} ❤️VVIP ROCKY Call Girl in Dehradun U...Sheetaleventcompany
 
Jual Obat Aborsi Di Dubai UAE Wa 0838-4800-7379 Obat Penggugur Kandungan Cytotec
Jual Obat Aborsi Di Dubai UAE Wa 0838-4800-7379 Obat Penggugur Kandungan CytotecJual Obat Aborsi Di Dubai UAE Wa 0838-4800-7379 Obat Penggugur Kandungan Cytotec
Jual Obat Aborsi Di Dubai UAE Wa 0838-4800-7379 Obat Penggugur Kandungan Cytotecjualobat34
 
Cardiac Output, Venous Return, and Their Regulation
Cardiac Output, Venous Return, and Their RegulationCardiac Output, Venous Return, and Their Regulation
Cardiac Output, Venous Return, and Their RegulationMedicoseAcademics
 
Pune Call Girl Service 📞9xx000xx09📞Just Call Divya📲 Call Girl In Pune No💰Adva...
Pune Call Girl Service 📞9xx000xx09📞Just Call Divya📲 Call Girl In Pune No💰Adva...Pune Call Girl Service 📞9xx000xx09📞Just Call Divya📲 Call Girl In Pune No💰Adva...
Pune Call Girl Service 📞9xx000xx09📞Just Call Divya📲 Call Girl In Pune No💰Adva...Sheetaleventcompany
 
💰Call Girl In Bangalore☎️63788-78445💰 Call Girl service in Bangalore☎️Bangalo...
💰Call Girl In Bangalore☎️63788-78445💰 Call Girl service in Bangalore☎️Bangalo...💰Call Girl In Bangalore☎️63788-78445💰 Call Girl service in Bangalore☎️Bangalo...
💰Call Girl In Bangalore☎️63788-78445💰 Call Girl service in Bangalore☎️Bangalo...gragneelam30
 
💚Chandigarh Call Girls 💯Riya 📲🔝8868886958🔝Call Girls In Chandigarh No💰Advance...
💚Chandigarh Call Girls 💯Riya 📲🔝8868886958🔝Call Girls In Chandigarh No💰Advance...💚Chandigarh Call Girls 💯Riya 📲🔝8868886958🔝Call Girls In Chandigarh No💰Advance...
💚Chandigarh Call Girls 💯Riya 📲🔝8868886958🔝Call Girls In Chandigarh No💰Advance...Sheetaleventcompany
 
tongue disease lecture Dr Assadawy legacy
tongue disease lecture Dr Assadawy legacytongue disease lecture Dr Assadawy legacy
tongue disease lecture Dr Assadawy legacyDrMohamed Assadawy
 
👉 Amritsar Call Girls 👉📞 8725944379 👉📞 Just📲 Call Ruhi Call Girl Near Me Amri...
👉 Amritsar Call Girls 👉📞 8725944379 👉📞 Just📲 Call Ruhi Call Girl Near Me Amri...👉 Amritsar Call Girls 👉📞 8725944379 👉📞 Just📲 Call Ruhi Call Girl Near Me Amri...
👉 Amritsar Call Girls 👉📞 8725944379 👉📞 Just📲 Call Ruhi Call Girl Near Me Amri...Sheetaleventcompany
 

Último (20)

Intramuscular & Intravenous Injection.pptx
Intramuscular & Intravenous Injection.pptxIntramuscular & Intravenous Injection.pptx
Intramuscular & Intravenous Injection.pptx
 
Gastric Cancer: Сlinical Implementation of Artificial Intelligence, Synergeti...
Gastric Cancer: Сlinical Implementation of Artificial Intelligence, Synergeti...Gastric Cancer: Сlinical Implementation of Artificial Intelligence, Synergeti...
Gastric Cancer: Сlinical Implementation of Artificial Intelligence, Synergeti...
 
👉Chandigarh Call Girl Service📲Niamh 8868886958 📲Book 24hours Now📲👉Sexy Call G...
👉Chandigarh Call Girl Service📲Niamh 8868886958 📲Book 24hours Now📲👉Sexy Call G...👉Chandigarh Call Girl Service📲Niamh 8868886958 📲Book 24hours Now📲👉Sexy Call G...
👉Chandigarh Call Girl Service📲Niamh 8868886958 📲Book 24hours Now📲👉Sexy Call G...
 
Control of Local Blood Flow: acute and chronic
Control of Local Blood Flow: acute and chronicControl of Local Blood Flow: acute and chronic
Control of Local Blood Flow: acute and chronic
 
Electrocardiogram (ECG) physiological basis .pdf
Electrocardiogram (ECG) physiological basis .pdfElectrocardiogram (ECG) physiological basis .pdf
Electrocardiogram (ECG) physiological basis .pdf
 
Race Course Road } Book Call Girls in Bangalore | Whatsapp No 6378878445 VIP ...
Race Course Road } Book Call Girls in Bangalore | Whatsapp No 6378878445 VIP ...Race Course Road } Book Call Girls in Bangalore | Whatsapp No 6378878445 VIP ...
Race Course Road } Book Call Girls in Bangalore | Whatsapp No 6378878445 VIP ...
 
💚Call Girls In Amritsar 💯Anvi 📲🔝8725944379🔝Amritsar Call Girl No💰Advance Cash...
💚Call Girls In Amritsar 💯Anvi 📲🔝8725944379🔝Amritsar Call Girl No💰Advance Cash...💚Call Girls In Amritsar 💯Anvi 📲🔝8725944379🔝Amritsar Call Girl No💰Advance Cash...
💚Call Girls In Amritsar 💯Anvi 📲🔝8725944379🔝Amritsar Call Girl No💰Advance Cash...
 
Cara Menggugurkan Kandungan Dengan Cepat Selesai Dalam 24 Jam Secara Alami Bu...
Cara Menggugurkan Kandungan Dengan Cepat Selesai Dalam 24 Jam Secara Alami Bu...Cara Menggugurkan Kandungan Dengan Cepat Selesai Dalam 24 Jam Secara Alami Bu...
Cara Menggugurkan Kandungan Dengan Cepat Selesai Dalam 24 Jam Secara Alami Bu...
 
7 steps How to prevent Thalassemia : Dr Sharda Jain & Vandana Gupta
7 steps How to prevent Thalassemia : Dr Sharda Jain & Vandana Gupta7 steps How to prevent Thalassemia : Dr Sharda Jain & Vandana Gupta
7 steps How to prevent Thalassemia : Dr Sharda Jain & Vandana Gupta
 
❤️Amritsar Escorts Service☎️9815674956☎️ Call Girl service in Amritsar☎️ Amri...
❤️Amritsar Escorts Service☎️9815674956☎️ Call Girl service in Amritsar☎️ Amri...❤️Amritsar Escorts Service☎️9815674956☎️ Call Girl service in Amritsar☎️ Amri...
❤️Amritsar Escorts Service☎️9815674956☎️ Call Girl service in Amritsar☎️ Amri...
 
Kolkata Call Girls Shobhabazar 💯Call Us 🔝 8005736733 🔝 💃 Top Class Call Gir...
Kolkata Call Girls Shobhabazar  💯Call Us 🔝 8005736733 🔝 💃  Top Class Call Gir...Kolkata Call Girls Shobhabazar  💯Call Us 🔝 8005736733 🔝 💃  Top Class Call Gir...
Kolkata Call Girls Shobhabazar 💯Call Us 🔝 8005736733 🔝 💃 Top Class Call Gir...
 
Chandigarh Call Girls Service ❤️🍑 9809698092 👄🫦Independent Escort Service Cha...
Chandigarh Call Girls Service ❤️🍑 9809698092 👄🫦Independent Escort Service Cha...Chandigarh Call Girls Service ❤️🍑 9809698092 👄🫦Independent Escort Service Cha...
Chandigarh Call Girls Service ❤️🍑 9809698092 👄🫦Independent Escort Service Cha...
 
Dehradun Call Girls Service {8854095900} ❤️VVIP ROCKY Call Girl in Dehradun U...
Dehradun Call Girls Service {8854095900} ❤️VVIP ROCKY Call Girl in Dehradun U...Dehradun Call Girls Service {8854095900} ❤️VVIP ROCKY Call Girl in Dehradun U...
Dehradun Call Girls Service {8854095900} ❤️VVIP ROCKY Call Girl in Dehradun U...
 
Jual Obat Aborsi Di Dubai UAE Wa 0838-4800-7379 Obat Penggugur Kandungan Cytotec
Jual Obat Aborsi Di Dubai UAE Wa 0838-4800-7379 Obat Penggugur Kandungan CytotecJual Obat Aborsi Di Dubai UAE Wa 0838-4800-7379 Obat Penggugur Kandungan Cytotec
Jual Obat Aborsi Di Dubai UAE Wa 0838-4800-7379 Obat Penggugur Kandungan Cytotec
 
Cardiac Output, Venous Return, and Their Regulation
Cardiac Output, Venous Return, and Their RegulationCardiac Output, Venous Return, and Their Regulation
Cardiac Output, Venous Return, and Their Regulation
 
Pune Call Girl Service 📞9xx000xx09📞Just Call Divya📲 Call Girl In Pune No💰Adva...
Pune Call Girl Service 📞9xx000xx09📞Just Call Divya📲 Call Girl In Pune No💰Adva...Pune Call Girl Service 📞9xx000xx09📞Just Call Divya📲 Call Girl In Pune No💰Adva...
Pune Call Girl Service 📞9xx000xx09📞Just Call Divya📲 Call Girl In Pune No💰Adva...
 
💰Call Girl In Bangalore☎️63788-78445💰 Call Girl service in Bangalore☎️Bangalo...
💰Call Girl In Bangalore☎️63788-78445💰 Call Girl service in Bangalore☎️Bangalo...💰Call Girl In Bangalore☎️63788-78445💰 Call Girl service in Bangalore☎️Bangalo...
💰Call Girl In Bangalore☎️63788-78445💰 Call Girl service in Bangalore☎️Bangalo...
 
💚Chandigarh Call Girls 💯Riya 📲🔝8868886958🔝Call Girls In Chandigarh No💰Advance...
💚Chandigarh Call Girls 💯Riya 📲🔝8868886958🔝Call Girls In Chandigarh No💰Advance...💚Chandigarh Call Girls 💯Riya 📲🔝8868886958🔝Call Girls In Chandigarh No💰Advance...
💚Chandigarh Call Girls 💯Riya 📲🔝8868886958🔝Call Girls In Chandigarh No💰Advance...
 
tongue disease lecture Dr Assadawy legacy
tongue disease lecture Dr Assadawy legacytongue disease lecture Dr Assadawy legacy
tongue disease lecture Dr Assadawy legacy
 
👉 Amritsar Call Girls 👉📞 8725944379 👉📞 Just📲 Call Ruhi Call Girl Near Me Amri...
👉 Amritsar Call Girls 👉📞 8725944379 👉📞 Just📲 Call Ruhi Call Girl Near Me Amri...👉 Amritsar Call Girls 👉📞 8725944379 👉📞 Just📲 Call Ruhi Call Girl Near Me Amri...
👉 Amritsar Call Girls 👉📞 8725944379 👉📞 Just📲 Call Ruhi Call Girl Near Me Amri...
 

PPT_14.pptx

  • 1. Unit 1 Basic of computer graphics By: Medhavi Pandey
  • 2. Outline ⮚Circle Generating Algorithms ▪ Mid Point Circle drawing algorithm. ▪ Numerical Practice
  • 3. Mid –Point Circle Algorithm • Given the center point and radius of circle, Mid Point Circle Drawing Algorithm attempts to generate the points of one octant. • The points for other octants are generated using the eight symmetry property.
  • 4. Mid –Point Circle Algorithm • Procedure- • Given- • Centre point of Circle = (X0, Y0) • Radius of Circle = R • Step-01: • Assign the starting point coordinates (X0, Y0) as- • X0 = 0 • Y0 = R
  • 5. Mid –Point Circle Algorithm • Step-02: • Calculate the value of initial decision parameter P0 as- • P0 = 1 – R • Step-03: • Suppose the current point is (Xk, Yk) and the next point is (Xk+1, Yk+1). • Find the next point of the first octant depending on the value of decision parameter Pk. • Follow the below two cases-
  • 6.
  • 7. Algorithm • Step1: input radius r, center (xc ,yc) and obtain the first point on the circumference of a circle centered on an origin ( (x,y) =(0,r) ) • Put x =0, y =r • Calculate initial value decision parameter as p=1-r • Step2: Repeat steps while x ≤ y Plot (x, y) If (p<0) Then set x=x+1 Y=y P = P + 2x + 3
  • 8. • Else P = P + 2(x-y)+1 y =y - 1 x =x+1 • To find the points for other seven octants, follow the eight symmetry property of circle.
  • 9. Problem: Given the centre point coordinates (0, 0) and radius as 10, generate all the points to form a circle. • Solution: Given- • Centre Coordinates of Circle (X0, Y0) = (0, 0) • Radius of Circle = 10 • Step-01: • Assign the starting point coordinates (X0, Y0) as- • X0 = 0 • Y0 = R = 10
  • 10. • Calculate the value of initial decision parameter P0 as- • P0 = 1 – R • P0 = 1 – 10 • P0 = -9 • As Pinitial < 0, so case-01 is satisfied. • Thus, • Xk+1 = Xk + 1 = 0 + 1 = 1 • Yk+1 = Yk = 10 • Pk+1 = Pk + 2 * Xk+1 + 3 = -9 + (2 x 1) + 1 = -6
  • 11. Pk Pk+1 (Xk+1, Yk+1) (0, 10) -9 -6 (1, 10) -6 -1 (2, 10) -1 6 (3, 10) 6 -3 (4, 9) -3 8 (5, 9) 8 5 (6, 8)
  • 12. • Algorithm calculates all the points of octant-1 and terminates. • Now, the points of octant-2 are obtained using the mirror effect by swapping X and Y coordinates. Octant-1 Points Octant-2 Points (0, 10) (8, 6) (1, 10) (9, 5) (2, 10) (9, 4) (3, 10) (10, 3) (4, 9) (10, 2) (5, 9) (10, 1) (6, 8) (10, 0) Now, the points for rest of the part are generated by following the signs of other quadrants. The other points can also be generated by calculating each octant separately.
  • 13. Advantages of Mid Point Circle Drawing Algorithm • It is a powerful and efficient algorithm. • The entire algorithm is based on the simple equation of circle X2 + Y2 = R2. • It is easy to implement from the programmer’s perspective. • This algorithm is used to generate curves on raster displays.
  • 14. Disadvantages of Mid Point Circle Drawing Algorithm • Accuracy of the generating points is an issue in this algorithm. • The circle generated by this algorithm is not smooth. • This algorithm is time consuming.
  • 15. Difference Between Midpoint Circle Algorithm And Bresenham's Circle Algorithm Midpoint Circle Algorithm Bresenham's Circle Algorithm This algorithm is used to generate curves on raster displays. It is quite Simple to implement. Bresenham's circle algorithm is simply an optimized version of the Midpoint circle algorithm. So, it needs very less time and requires less memory consuming Mid Point may still needs floating point. Although it also avoids square root or trigonometric calculation by adopting integer operation only. It uses just integer arithmetics. Accuracy of the generating points is an issue in this algorithm. Algorithm is accurate and efficient as it avoids using round function or floating point calculations.