1. I have a bit of a problem, I need to turn X and Y coordinates into an angle fron the centre of a shape. I have a 10 by 10 grid, and I am detecting presses, I need to work out the angle those presses are at relative to the center of the grid.

So basicly I want to convert X and Y coordinates into a heading. A formula to do this would be brilliant (sorry for the bad diagram and possibly bad explination)

2. like a local vector 2 get to it

Edited:

?

3. Yes, exactly!

Edited:

I just need an algebra formula, that would be perfect.

4. If I remember correctly then you can use atan to get the angular heading from a set of (normalized) coordinates,

I think it was something like
Code:
`double ang = atan2(x, -y);`

5. in 3d angles , i would do this

local header = destination - Player.Getpos()

or somthing like that , its one way or the other , it works in wire , i know that
Dumb x 6 (list)

6. use sin, cos, tan (http://en.wikipedia.org/wiki/Trigonometric_functions)

http://www.cplusplus.com/reference/clibrary/cmath/atan/

```double ang = atan(Y/X);
```
Yea its also possible to use atan2 its the same thing

`sqrt(pow(X,2) + pow(Y,2))`
The lenght
`ang * 180 / PI`

Everything should be done using normalized vectors.

7. Yea its also possible to use atan2 its the same thing
Actually you want to use atan2 and not atan, because atan doesn't give the correct angle for each quadrant.
Disagree x 1 (list)

8. Yea its also possible to use atan2 its the same thing.
wrooooooooooooooooooooooong.
Funny x 1 Dumb x 1 (list)

9. Classic GCSE math question.

Edited:

Assuming x is right, and y is up.

10. If I remember correctly then you can use atan to get the angular heading from a set of (normalized) coordinates,

I think it was something like
Code:
`double ang = atan2(x, -y);`
I'm pretty sure the first parameter for atan2 is usually y.

11. Thanks for the help, I have my C in Maths (Not my strong point), so I dropped it and moved onto Graphics...