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

Midpoint Circle Algorithm

The Mid Point Circle Drawing Algorithm generates points for a circle based on its center and radius, utilizing symmetry to create points for all octants. It involves calculating decision parameters and iterating through points until the desired octant is completed. While efficient and easy to implement, the algorithm has drawbacks such as accuracy issues and time consumption.

Uploaded by

shrigujar25
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Midpoint Circle Algorithm

The Mid Point Circle Drawing Algorithm generates points for a circle based on its center and radius, utilizing symmetry to create points for all octants. It involves calculating decision parameters and iterating through points until the desired octant is completed. While efficient and easy to implement, the algorithm has drawbacks such as accuracy issues and time consumption.

Uploaded by

shrigujar25
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 10

Mid Point Circle

Drawing Algorithm-

Given the centre point and radius of circle, Mid Point Circle Drawing Algorithm attempts
to generate the points of one octant.

The points for other octacts are generated using the eight symmetry property.

• 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).
Find the next point of the first octant depending on the value of decision
parameter Pk .
Follow the below two cases-
Step-04:
This step is used when x and y coordinates are not at origin (0,0).
• 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.
To find the points for other seven octants, follow the eight symmetry property of
This is depicted by the following figure-
PRACTICE PROBLEMS BASED ON MID POINT CIRCLE DRAWING
ALGORITHM
Problem-01:
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 ) asX0 = 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
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).
Step-05: Step-03 is executed similarly until Xk+1 >= Yk+1 as follows
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)
These are all points for Quadrant-1.
Advantages of Mid Point Circle Drawing Algorithm
The advantages of Mid Point Circle Drawing Algorithm are
• It is a powerful and efficient algorithm.
• The entire algorithm is based on the simple equation of circle X^2 + Y ^2 = R^2 .
• 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


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.

You might also like