Solved

# Grid coordinates from range and bearing

Posted on 2011-03-09

I have the following code which gives me range and heading when a user clicks on a grid.

Grid is 100x100 so the centre is 50,50

User clicks @ X,Y

range = System.Math.Sqrt(

System.Math.Pow(System.Math.Sqrt( System.Math.Pow((50-Y),2)),2)

+

System.Math.Pow(System.Math.Sqrt( System.Math.Pow((50-X),2)),2)

);

heading = System.Math.Atan2(50- X, 50 - Y) * 180 / System.Math.PI + 180;

This works OK but I want to reverse the process and get X and Y from range and heading?

Any ideas?

Thanks