I'm missing one value for that. With the formula for Cross-track distance I got the distance from my current position but not the actual position on the line. To calculate that position I would need a bearing and to calculate a bearing I would need the position. At least if I use the given formulas on that site.
X
|
|
|
A----Y---------------------------------------B
What value are you trying to get? Assume for a second that A was the start point, B is the target, X is the current position, and Y is the point on the segment A-B closest to X...
X
|
|
|
A----Y---------------------------------------B
It seems that you are asking to calculate the bearing from X to Y, but that doesn't seem like useful information. If the user originally wanted to get from A to B, and they are now at X, it seems like they want to know how to get from X to B.
That drawing doesn't make any sense. The sum of the angles in a triangle is always exactly 180°. If x is an angle of 100°, then y cannot possibly be 90°. In that picture it seems to me that x is supposed to be the length of the segment from A-D, and z is the length of the segment C-D, and both are mislabeled as angles.
Travis