Steel
Software Engineer
- Reaction score
- 109
JASS:
Some very simple functions that can help determine the coordinates of a point on a circle.
Example
Given: Circle with center at (50,50) with radius 50.
Problem: You want to find the X,Y coordinate for the position at 0º
Solution: You can do that yourself easily, just move to the outer point from the center over the distance of the radius the math on that is simple and you can do it yourself just looking at it. The right angles are all easy to do, even the quarters are if you know your unit circle.
Problem: You want to find the X,Y coordinate for the position at 82.7º that doesn't fit the unit circle and you can't eyeball that one. So we need to use the functions above.
set new_x = GetPointOnCircleX(50, 50, 82.7)
set new_y = GetPointOnCircleY(50, 50, 82.7)
Remember this is points ON the circle, not inside it, not near it, on the actual circle.