**Circle generation algorithm**

Where,

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.

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

sin Î¸ = y / r

sin Î¸ = x / r

x = r cos Î¸

y = r sin Î¸

where,

Î¸= 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