0
$\begingroup$

I have two Vectors on a sphere, and I am trying to figure out how to plot points along a curve between the two Vectors at an arbitrary distance between the two. I know the position of the start and end Vector, as well as the radius of the sphere. Can anyone help me formulate and come to an understanding of the equation I would or could use to achieve plotting these points? I looked into the great circle distance, but was unsure how to get more than just the distance from the equation, as I want to plot objects along this course. I have included an image for reference, of what I am trying to achieve. Thanks in advanced for any help and understanding that you may be able to provide!

Rough sketch of what I am trying to achieve

$\endgroup$
3
  • 1
    $\begingroup$ Given two points $p_0$, $p_1$ which subtend an angle $\theta \in (0,\pi)$ in between, you can parameterize the arc joining them by a slerp: $$\verb/Slerp/(p_0,p_1;t) = \frac{\sin((1-t)\theta)}{\sin\theta} p_0 + \frac{\sin(t\theta)}{\sin(\theta)}p_1\quad\text{ with }\quad 0 \le t \le 1$$ Is this what you want? $\endgroup$ Aug 31 '17 at 1:40
  • $\begingroup$ This is exactly what I was looking for. Thanks! $\endgroup$ Aug 31 '17 at 1:49
  • $\begingroup$ An equivalent method is to get the normal to your two vectors, and then use the Rodrigues (axis-angle) rotation formula to interpolate between them. $\endgroup$ Aug 31 '17 at 4:18
0
$\begingroup$

Given two unit vectors $p_0$ and $p_1$, $|p_0|=|p_1|=1$, such that if $c:=p_0\cdot p_1$ then $|c|\ne 1$, compute $q:=p_1-c\:p_0$, and third point $p_2:=q/|q|$. We have now $p_0\cdot p_2=0$ and $|p_2|=1$. The circle passing through the three points is given by $p:=\cos(\theta)p_0+\sin(\theta)p_2$ where the angle $\theta=0$ for $p=p_0$, $\;\theta=\pi/2\;$ for $p=p_2,\;$ and $c=\cos(\theta)$ for $p=p_1$.

Another approach is to use linear interpolation and then normalize to a unit vector, similar to the comment about $\texttt{ Slerp()}$. Let $0\le t\le 1$, $q:=(1-t)p_0+tp_1$ and $p:=q/|q|$ is the new point.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.