Convert [X,Y] to degrees

if I have an two XY coordinates (one of which will always be [0,0]) have does one calcuate the angle between them… Guess old age is catching up, I used to know this off the top of my head

Is this what you need?

An arc tangent will give you the angle of the second point relative to the origin (0,0) — atan(x,y) in most languages. Remember that the returned angle first needs to be converted from radians to degrees.

1 Like

yup :slight_smile:

 let angle = atan2(cell.x-theACTOR!.location.x,cell.y-theACTOR!.location.y) * (180 / Double.pi)