0
$\begingroup$

I'm new here so sorry if this is a really silly question but I can't solve it myself.

If I have two points on a unit sphere, A and B, and the shortest path from A to B over the surface of the sphere, then how do I calculate the direction of this line at point B (as a vector)?

Do I need to compute this using quaternions? I have read a bit about it but find it very hard to understand how to use them. Alternatively, if rotation matrices can be used I would be very happy too.

  • 0
    the answers there are "essentially" the same as the answer given by Peter H. here. He manages to do it with less words though :-). OTOH he doesn't need to discuss the conversions from one coordinate system to another.2012-05-31

2 Answers 2

2

The shortest paths connecting two points on a sphere are arcs of great circles, so the direction you are looking for is the tangent to the great circle containing $A$ and $B$. This tangent

  • lies in the plane of the great circle, i.e. is orthogonal to the plane normal given by $A \times B$
  • is orthogonal to the location vector of $B$

Therefore the direction that points from $B$ towards $A$ is the cross product of these two vectors, given by $B \times (A \times B)$.

  • 0
    On a side note, how does the magnitude of this vector relate to the derivative?2012-05-31
0

This works provided the points are not antipodes. Write an equation for the line connecting the two points; that is of the form $r(t) = (a + bt){\rm\bf i} + (c + dt){\rm\bf j} + (e + ft){\rm\bf k}. $ Now divide out by the norm of this function and you have it.