Home » Defining a Circle using Polynomial Method

Defining a Circle using Polynomial Method

by Online Tutorials Library

Defining a circle using Polynomial Method:

The first method defines a circle with the second-order polynomial equation as shown in fig:

                    y2=r2-x2
Where x = the x coordinate
          y = the y coordinate
          r = the circle radius

With the method, each x coordinate in the sector, from 90° to 45°, is found by stepping x from 0 to Defining a circle using Polynomial Method & each y coordinate is found by evaluating Defining a circle using Polynomial Method for each step of x. Defining a circle using Polynomial Method

Algorithm:

Step1: Set the initial variables
          r = circle radius
          (h, k) = coordinates of circle center
                x=o
                I = step size
                xend= Defining a circle using Polynomial Method

Step2: Test to determine whether the entire circle has been scan-converted.

If x > xend then stop.

Step3: Compute y = Defining a circle using Polynomial Method

Step4: Plot the eight points found by symmetry concerning the center (h, k) at the current (x, y) coordinates.

                Plot (x + h, y +k)          Plot (-x + h, -y + k)
                Plot (y + h, x + k)          Plot (-y + h, -x + k)
                Plot (-y + h, x + k)          Plot (y + h, -x + k)
                Plot (-x + h, y + k)          Plot (x + h, -y + k)

Step5: Increment x = x + i

Step6: Go to step (ii).

Program to draw a circle using Polynomial Method:

Output:

Defining a circle using Polynomial Method


You may also like