Past exam question: 2081 Chaitra (Regular), Q2(a)
Open in the Padhaiko appHow the decision parameter can be used to draw a Circle? Draw the circle with the radius 7 and centre (10,15).
Solution
Decision Parameter in the Midpoint Circle Algorithm: In the Midpoint Circle Algorithm, the decision parameter is used to determine which of two candidate pixels lies closer to the actual circular boundary defined by . In the first octant ( to , where the curve slope ranges from to ):
- Given currently plotted pixel , the next pixel must be either:
- Pixel East:
- Pixel South-East:
- The algorithm tests the midpoint between these two candidates by substituting it into the circle function:
Decision Rule:
- If : The midpoint lies strictly inside the circle boundary. The upper pixel is closer.
- Choose .
- Next parameter: .
- If : The midpoint lies on or outside the circle boundary. The lower pixel is closer.
- Choose .
- Next parameter: .
Starting at , the initial decision parameter evaluated with integer arithmetic is:
Initial Conditions for Radius : Given radius and center :
- Initial point in the first octant (relative to origin):
- Initial decision parameter:
Step-by-Step Computation for First Octant: We iterate until :
| Chosen Pixel | Calculation | ||||
|---|---|---|---|---|---|
| 0 | () | ||||
| 1 | () | ||||
| 2 | () | ||||
| 3 | () | ||||
| 4 | () |
The loop terminates at because .
The resulting points in the first octant (origin-centered) are:
Applying 8-Way Symmetry and Translation to Center : Using 8-way symmetry, every octant point generates 8 points on the circle: and with center :
- For :
- For :
- For :
- For :
- For :
- For :
- The decision parameter tests whether the midpoint between candidate pixels lies inside () or outside () the circle boundary.
- For radius , the first-octant coordinates are:
Translated to center using 8-way symmetry, these map to the complete circular raster boundary.
All past exam questions for Computer Graphics and Visualization