Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find the point with radius and angle

I'm not a genius in geometry, I'd like to find a point in as3 with the radius and a angle but I don't remember the rule, I know this should be simple!

Here's an example:

alt text http://img297.imageshack.us/img297/4879/examplepr.png

like image 376
vitto Avatar asked May 22 '10 09:05

vitto


People also ask

How do you find a point with a point and an angle?

Learn to love math! (Or at least understand it.) If your starting point is (0,0), and your new point is r units away at an angle of θ, you can find the coordinates of that point using the equations x = r cosθ and y = r sinθ.


1 Answers

as3.x = centerX + radius * cos(angle)
as3.y = centerY + radius * sin(angle)

Note that the rotation in the picture linked to is in the "negative direction". I.e, an increase of the angle, yields a counter-clockwise rotation.

like image 156
aioobe Avatar answered Nov 15 '22 22:11

aioobe