
metadata
I have a point in a movieclip that is set to (22,5), so if the movieclip rotated around its centre 90 degrees, the point would then be at (5,22). During the game; the movieclip rotates around to the position of the mouse, and I need to know the exact location of that point at all times. Of course tracing its coordinates gives me (22,5) every time, no matter how the parent movieclip is rotated.
![](http://i373.photobucket.com/albums/oo173/Pizzaboy48/OffCentreRotation.jpg)
I know the trigonemtry I could use:
`xOffset = Math.sin(rotation*(Math.PI/180))*distance;
yOffset = Math.cos(rotation*(Math.PI/180))*distance;`
But from what I understand, that would only work if the point was aligned to an axis along the centre of rotation, like (22,0) or (0,5).
Can anyone help me?


metadata
`distance = Math.sqrt(22*22+5*5);`
`offsetAngle = Math.atan2(22, 5);`
* * *
`pointX = Math.sin(offsetAngle + rotation * Math.PI / 180) * distance;`
`pointY = Math.cos(offsetAngle + rotation * Math.PI / 180) * distance;`


metadata
Haha I can’t believe it’s that simple! Thanks again skyboy! :)


metadata
You could also use localToGlobal I think. I don’t know if it accounts for rotation.


metadata
> *Originally posted by **[BigJM](/forums/4/topics/311855#posts6584590):***
>
> You could also use localToGlobal I think. I don’t know if it accounts for rotation.
it accounts for everything, but it’s far slower than straight trig


metadata
I guess it would just transform the point using the object’s matrix.


metadata
Vector Math. Can occasionally be useful.
