0% found this document useful (0 votes)
250 views

Assignment Midpoint Circle Drawing Algorithm

The document describes the midpoint circle drawing algorithm. It begins with an introduction explaining that the algorithm is used to determine the points needed to rasterize a circle. It then provides a detailed description of the algorithm's steps and includes an example of applying the algorithm to generate points of a circle with a radius of 10 and center at (0,0). It concludes by discussing the merits and demerits of the midpoint circle drawing algorithm.

Uploaded by

Tayaba Rahaman
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
250 views

Assignment Midpoint Circle Drawing Algorithm

The document describes the midpoint circle drawing algorithm. It begins with an introduction explaining that the algorithm is used to determine the points needed to rasterize a circle. It then provides a detailed description of the algorithm's steps and includes an example of applying the algorithm to generate points of a circle with a radius of 10 and center at (0,0). It concludes by discussing the merits and demerits of the midpoint circle drawing algorithm.

Uploaded by

Tayaba Rahaman
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Assignment

Midpoint Circle Drawing Algorithm

Submitted To
Name: Professor Dr. Md. Ismail Jabiullah
Professor
Department of Computer Science and Engineering

Submitted By
Name: Md. Monjur Hasan Milton
ID: 171-15-9220
Section:O-7

References: https://www.gatevidyalay.com/mid-point-circle-drawing-
algorithm/?fbclid=IwAR10ED6XaxGhFXfSKO6xjja7uE3jZWq_eInA5nhinQtCmzHssAFaIK_JAlQ
Content List
Title Midpoint Circle Drawing Algorithm

Introduction Page #3

Description Page #3

Description Page #4

Description Page #5

Description Page #6

Example of mid point Page #6

Example of mid point Page #7

Example of mid point Page #8

Example of mid point Page #9

Example of mid point Page #10

Merits of mid point Page #10

algorithm

Demerits of mid point Page #11


algorithm
Conclusion Page #11

References: https://www.gatevidyalay.com/mid-point-circle-drawing-
algorithm/?fbclid=IwAR10ED6XaxGhFXfSKO6xjja7uE3jZWq_eInA5nhinQtCmzHssAFaIK_JAlQ
Intorduction:

The mid-point circle drawing algorithm is an algorithm used to


determine the points
needed for rasterizing a
circle.

We use the mid-point


algorithm to calculate all
the perimeter
points of the circle in
the first octant and
then print them along
with their mirror
points in the other
octants. This will
work because a circle is symmetric about it’s centre.

References: https://www.gatevidyalay.com/mid-point-circle-drawing-
algorithm/?fbclid=IwAR10ED6XaxGhFXfSKO6xjja7uE3jZWq_eInA5nhinQtCmzHssAFaIK_JAlQ
Description:

Given-

 Centre point of Circle = (X0, Y0)


 Radius of Circle = R

The points generation using Mid Point Circle Drawing Algorithm


involves the following steps.

Step-01:

Assign the starting point coordinates (X0, Y0) as-

 X0 = 0
 Y0 = R

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).

References: https://www.gatevidyalay.com/mid-point-circle-drawing-
algorithm/?fbclid=IwAR10ED6XaxGhFXfSKO6xjja7uE3jZWq_eInA5nhinQtCmzHssAFaIK_JAlQ
If Step-04:
The given centre point (X0, Y0) is not (0, 0), then do the following and
plot the point-

 Xplot = Xc + X0
 Yplot = Yc + Y0
 Here, (Xc, Yc) denotes the current value of X and Y coordinates.

Step-05:

Keep repeating Step-03 and Step-04 until Xplot >= Yplot.

Step-06:

Step-05 generates all the points for one octant.


5

References: https://www.gatevidyalay.com/mid-point-circle-drawing-
algorithm/?fbclid=IwAR10ED6XaxGhFXfSKO6xjja7uE3jZWq_eInA5nhinQtCmzHssAFaIK_JAlQ
To find the points for other seven octants, follow the eight
symmetry property of circle.

This is depicted by the following figure

Example of Mid Point Circle Drawing Algorithm:

Given the centre point coordinates (0, 0) and radius as 10, generate all
the points to form a circle.

Solution-

Given-

References: https://www.gatevidyalay.com/mid-point-circle-drawing-
algorithm/?fbclid=IwAR10ED6XaxGhFXfSKO6xjja7uE3jZWq_eInA5nhinQtCmzHssAFaIK_JAlQ
 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

Step-02:

Calculate the value of initial decision parameter P0 as-

P0 = 1 – R

P0 = 1 – 10

P0 = -9

Step-03:

As Pinitial < 0, so case-01 is satisfied.

Thus,

 Xk+1 = Xk + 1 = 0 + 1 = 1
 Yk+1 = Yk = 10
 Pk+1 = Pk + 2 x Xk+1 + 1 = -9 + (2 x 1) + 1 = -6

Step-04:

This step is not applicable here as the given centre point coordinates is
(0, 0).

References: https://www.gatevidyalay.com/mid-point-circle-drawing-
algorithm/?fbclid=IwAR10ED6XaxGhFXfSKO6xjja7uE3jZWq_eInA5nhinQtCmzHssAFaIK_JAlQ
Step-05:

Step-03 is executed similarly until Xk+1 >= Yk+1 as follows-

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.

References: https://www.gatevidyalay.com/mid-point-circle-drawing-
algorithm/?fbclid=IwAR10ED6XaxGhFXfSKO6xjja7uE3jZWq_eInA5nhinQtCmzHssAFaIK_JAlQ
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.

Here, all the points have been generated with respect to quadrant-1-

References: https://www.gatevidyalay.com/mid-point-circle-drawing-
algorithm/?fbclid=IwAR10ED6XaxGhFXfSKO6xjja7uE3jZWq_eInA5nhinQtCmzHssAFaIK_JAlQ
Merits of Mid Point Circle Drawing Algorithm

The advantages of Mid Point Circle Drawing Algorithm are-

10

References: https://www.gatevidyalay.com/mid-point-circle-drawing-
algorithm/?fbclid=IwAR10ED6XaxGhFXfSKO6xjja7uE3jZWq_eInA5nhinQtCmzHssAFaIK_JAlQ
 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.

Demerits of Mid Point Circle Drawing Algorithm

The disadvantages of Mid Point Circle Drawing Algorithm are-


 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.

Conclusion:

 Circle drawing algorithms take the advantage of 8 symmetry


property of circle.
 Every circle has 8 octants and the circle drawing algorithm
generates all the points for one octant.
 The points for other 7 octants are generated by changing the sign
towards X and Y coordinates.
 To take the advantage of 8 symmetry property, the circle must be
formed assuming that the centre point coordinates is (0, 0).
 If the centre coordinates are other than (0, 0), then we add the X
and Y coordinate values with each point of circle with the
coordinate values generated by assuming (0, 0) as centre point.

11

References: https://www.gatevidyalay.com/mid-point-circle-drawing-
algorithm/?fbclid=IwAR10ED6XaxGhFXfSKO6xjja7uE3jZWq_eInA5nhinQtCmzHssAFaIK_JAlQ
12

References: https://www.gatevidyalay.com/mid-point-circle-drawing-
algorithm/?fbclid=IwAR10ED6XaxGhFXfSKO6xjja7uE3jZWq_eInA5nhinQtCmzHssAFaIK_JAlQ

You might also like