Tagyourareit
asked on
Get heading between two points
Hello,
Could someone please try and solve this math problem for me:
i have two coordinates A and B and i need to calculate heading between those two.
Now by heading i want to get direction i am facing if i go from point A to point B.
Now i have checked heading in application and it goes like this:
X1 = 67749,79
Y1 = -75603,24
Z1 = -2854,271
X2 = 67801,95
Y2= -75648,37
Z2 = -2823,197
Heading should be: -7423
This i get from one application (i dont have source code for it so i dont know how heading is calculated but it should be correct).
tried with ATAN2 but it doesnt return same resoult.
Thank you!
Could someone please try and solve this math problem for me:
i have two coordinates A and B and i need to calculate heading between those two.
Now by heading i want to get direction i am facing if i go from point A to point B.
Now i have checked heading in application and it goes like this:
X1 = 67749,79
Y1 = -75603,24
Z1 = -2854,271
X2 = 67801,95
Y2= -75648,37
Z2 = -2823,197
Heading should be: -7423
This i get from one application (i dont have source code for it so i dont know how heading is calculated but it should be correct).
tried with ATAN2 but it doesnt return same resoult.
Thank you!
ASKER
Hello,
How are you expressing a direction in 3-D space?
What do u mean by that?What does a heading of -7423 mean?
Its a short ... Signed 16-bit integer
ASKER
I've requested that this question be deleted for the following reason:
Its a badly formulated question. Let me think about it and will post better one.
Its a badly formulated question. Let me think about it and will post better one.
A direction in three-dimensional space is usually expressed with two or three real numbers. e.g. as altitude&azimuth or as direction cosines or as a unit vector, ...
How are you describing a direction as a single integer?
How are you describing a direction as a single integer?
ASKER
Well function i have is like this:
public static short GetHeading(float x, float y)
{
return (short) (Math.Atan2(y, x)*32768/Math.PI);
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I will accept the answer its partially what i want.
Thank you for now.
Thank you for now.
What does a heading of -7423 mean?