Friday, June 14, 2019

Circle generation algorithm

Circle generation algorithm

A circle is a symmetrical figure with 8 symmetrical figure with 8 symmetrical region with the 8 different point. Which are plot on a same plane surface 8 way symmetric is used by reflecting each point around each 45 degree axis.
Circle generation algorithm

            P1 = (x,y)
            P2 = (y,x)
            P3 = (-y,x)
            P4 = (-x,y) 
            P5 = (-x,-y)
            P6 = (-y,-x)
            P7 = (y,-x)
            P8 = (x,-y)
There are two standard method od methodically defining a circle centered at the origin.

1.First methodology defines a circle with the second order polynomial equation.
Circle generation algorithm

            r^2 = x^2+y^2
            r = √x^2+y^2
where x = x-coordinate
           y = y-coordinate
the second method of defining a circle with may use of trigonometric function
Circle generation algorithm

           sin θ = y / r
           sin θ = x / r
           x = r cos θ
           y = r sin θ
          θ= correct angle 
          r = radius of the circle
          x = x-coordinate , 
          y = y-coordinate.

By this method θ is stepped θ to π/4 and each value of x and y is calculated by the trigonometric function.
However computation of sinθ and cosθ is more time consuming then the calculation required by the first method.

No comments:

Post a Comment