Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Circles, mathematically

Name: Anonymous 2008-12-21 2:57

My math knowledge is limited, and I would appreciate some help.

How do I find the (x,y) coordinates of a point on a circle's perimeter based on the direction of a ray coming from the circle's origin?

Basically:

Input: Circle's origin coordinates, circle's radius, degree
Output: Coordinates of point where ray (coming from origin of circle) moving in the direction of [degree] hits the perimeter of the circle.

Preferably the degree input is the system of 0-359 degrees, where a number above or below that range would also work just as well, effectively 'wrapping around,' and making 360 work effectively as 0.

Sorry if my diction is poor, I am really not mathematically skilled at all, theory is more my game...

Name: Anonymous 2008-12-22 19:36

>>4

As long as you have relatively small Radian values for your angle -degrees won't work- you can use a two-to-three term Taylor Series Expansion Approximation for sin(angle) and cos(angle).

Recalling the coordinates mentioned earlier:

x ~= a + radius * (1 - Φ²/2 + (Φ^4)/24)
y ~= b + radius * (Φ - Φ³/6 + (Φ^5)/120)

where Φ is some small radian angle.

Now, dividing the fifth power of a fraction by 120 may not be the easiest mental math to do, its about all you can do save for memorizing a trig table.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List