Defining a Circle:
Circle is an eight-way symmetric figure. The shape of circle is the same in all quadrants. In each quadrant, there are two octants. If the calculation of the point of one octant is done, then the other seven points can be calculated easily by using the concept of eight-way symmetry.
For drawing, circle considers it at the origin. If a point is P1(x, y), then the other seven points will be
So we will calculate only 45°arc. From which the whole circle can be determined easily.
If we want to display circle on screen then the putpixel function is used for eight points as shown below:
putpixel (x, y, color)
putpixel (x, -y, color)
putpixel (-x, y, color)
putpixel (-x, -y, color)
putpixel (y, x, color)
putpixel (y, -x, color)
putpixel (-y, x, color)
putpixel (-y, -x, color)
Example: Let we determine a point (2, 7) of the circle then other points will be (2, -7), (-2, -7), (-2, 7), (7, 2), (-7, 2), (-7, -2), (7, -2)
These seven points are calculated by using the property of reflection. The reflection is accomplished in the following way:
The reflection is accomplished by reversing x, y co-ordinates.
There are two standards methods of mathematically defining a circle centered at the origin.
- Defining a circle using Polynomial Method
- Defining a circle using Polar Co-ordinates