How to calculate the direction of two AGSPoint

744
4
10-05-2013 09:25 AM
JamesZhang
New Contributor
I want to calculate the high precision direction of the two point ??The direction is calculated from the north of the earth.??.
How can I do it by the SDK.
Thanks very much.
0 Kudos
4 Replies
HumzaAkhtar
Occasional Contributor II
Can you explain your problem a little in detail? I am not sure if I understood the meaning of calculating the direction of two points. A point does not have a direction associated with it. It is just a point.
0 Kudos
RickJones
Occasional Contributor II
http://www.mathsisfun.com/algebra/trig-finding-angle-right-triangle.html

Get the change in x and y for the 2 points, and use trigonometry to calculate the angle.

You may have to offset the angle to account for North being 0.
0 Kudos
JamesZhang
New Contributor
Can you explain your problem a little in detail? I am not sure if I understood the meaning of calculating the direction of two points. A point does not have a direction associated with it. It is just a point.


Well, sorry for my poor English. I mean that:
Connecting two AGSPoint will make a straight line. Then the line will make a direction to the North of the Earth. (Just like the dirction of the compass)
0 Kudos
JamesZhang
New Contributor
http://www.mathsisfun.com/algebra/trig-finding-angle-right-triangle.html

Get the change in x and y for the 2 points, and use trigonometry to calculate the angle.

You may have to offset the angle to account for North being 0.


Thanks.
This is a way to do. But higher latitude value may cause some error.
0 Kudos