1

My question is rather simple. Can I use the dot product to determine if a coordinate lies between two others?

With coordinates I mean a Point P(latitude, longitude) on the surface of the sphere. I know that the dot product can be used in the plane for this problem. Do I have to convert the coordinates to cartesian ones to use the same technique on a sphere? Or can I use it straight away?

Edit:

enter image description here

The three points don't have to be collinear. Let's say the points A and B are the start and endpoints of a geodesic. The third point C could lie on that geodesic or it is an unknown distance away from it. I need to check if the latitude and longitude of point C is between the ones of A and B. So, I need to check if C is in between the two black lines.

May be it is more clear if you have a look at the picture.

  • To clarify: You want to find a simple way to determine if three points are collinear on the sphere, given their latitude and longitude? – Semiclassical Aug 20 '14 at 13:27
  • @Semiclassical Good point, I updated my question. – Steve Benett Aug 20 '14 at 13:33
  • I still don't understand. Is the answer to Semiclassical's question yes or no? If no, what are you asking? – Amitai Yuval Aug 20 '14 at 13:36
  • 2
    When you say 'between', do you mean in the following sense: Suppose I rotate the sphere such that $A$ and $B$ are at the same longitude but opposite latitude (e.g. North v. South America). Would the set of points between $A$ and $B$ be all those with latitude between $A$ and $B$? (So Central America but not the poles.) – Semiclassical Aug 20 '14 at 13:36
  • @AmitaiYuval Have a look at my edit, I hope it's more clear now. – Steve Benett Aug 20 '14 at 14:02
  • I'll explain what I don't understand. It really seems that what you want is exactly what Semiclassical offered above. Yet, you haven't still answered a simple "yes" to his/her question. – Amitai Yuval Aug 20 '14 at 14:08
  • @Semiclassical Ok, now I understand your point. Yes, that's exactly what I need. – Steve Benett Aug 20 '14 at 14:34
  • That last edit with the lines clarifies your intent. Though I suspect that the boundaries of your region of interest do not look like strait lines in this projection. – Semiclassical Aug 20 '14 at 14:46
  • @Semiclassical Of course the lines would be parallel arcs. That's the major reason why I'm not sure if I can use the dot product straight away. – Steve Benett Aug 20 '14 at 14:51
  • I don't understand how the black lines are defined. – Tim Carson Aug 20 '14 at 14:54
  • @TimCarson The black lines are the boundaries of the region between A and B. They are perpendicular to the geodesic between A and B. – Steve Benett Aug 20 '14 at 16:27
  • I think a non ambiguous description of the area we are looking for is the spherical wedge defined by $AB$ as its largest width. – Jean Marie Apr 03 '19 at 10:05

1 Answers1

2

For this answer I will not rely on Cartesian coordinates, but I will not work directly in terms of latitude and longitude either. Instead, it will be convenient to represent a point with spherical coordinates $(\phi,\theta)$ as $z=e^{i\phi}\tan\dfrac\theta2$, corresponding to a stereographic projection of the sphere into the complex plane. We can now apply Mobius transformations to move the complex numbers $\alpha$, $\beta$ (corresponding to $A$, $B$) to more helpful locations.

Specifically, we can use rotations to move $\alpha$ to zero, then map $\beta$ to the real line, and finally rotate $\{\alpha,\beta\}$ to $\{r,r^{-1}\}$ on the positive real line. This amounts to rotating our coordinates so that $A$ and $B$ have zero longitude and opposite latitudes. To make this simpler, we shall assume that $\alpha$ is real without loss of generality (i.e. we take the longitude of $B$ relative to $A$).

We now state these transforms explicitly. First, note that the subgroup of the Mobius group corresponding to rotations consists of mappings of the form $z\mapsto \dfrac{u z-\overline{v}}{v z+\overline{u}}$ for complex $u,v$. A mapping of this form which takes $\alpha$ to the origin is $z\mapsto \dfrac{z-\alpha}{\alpha z+1}$; this also maps $\beta\mapsto \dfrac{\beta-\alpha}{1+\beta\alpha}= R e^{i\psi}$ for some real $R,\psi$. A rotation $z\mapsto e^{-i\phi} z$ then brings $\beta$ to $R$.

For the last transformation, consider the mapping $z\mapsto \dfrac{1+z r}{r-z}$ for real $r>0$ which takes the real line to itself. Then $\{0,R\}\mapsto \left\{\dfrac{1}{r},\dfrac{1+r R}{r-R}\right\}$; since we want the images of $0$ and $R$ to be on equal and opposite sides of the 'equator', we require their product to be unity. From this we deduce $r=R+\sqrt{1+R^2}$. Composing the three transformation gives the net rotation

$$\mathcal{T}:\;z \mapsto \dfrac{z-\alpha}{1+\beta\alpha} \mapsto e^{i\phi}\left(\frac{z-\alpha}{1+\beta\alpha}\right) \mapsto \dfrac{1+e^{i\phi}\left(\frac{z-\alpha}{1+\beta\alpha}\right)r}{r-e^{i\phi}\left(\frac{z-\alpha}{1+\beta\alpha}\right)} =\dfrac{e^{-i\phi}(1+\beta\alpha)+(z-\alpha)r}{r e^{-i\phi}(1+\beta\alpha)-(z-\alpha)}$$

We now can give a criterion for the original question: a point $z$ lies between $\alpha$ and $\beta$ if $r^{-1}\leq | \mathcal{T}(z)|r$. In principle one can do inverse transformations to map this annulus back to the original coordinates, but I won't do so explicitly. Instead I'll just summarize the result:

Let $\alpha,\beta$ be the stereographic coordinates of two points $A,B$ on the unit sphere, and define $w=R e^{i\phi}:=\dfrac{\beta-\alpha}{1+\beta\alpha}$. Then a point $C$ on the unit sphere lies between $A$ and $B$ iff its sterographic coordinate $z$ satisfies $$\frac{1}{r}< \left|\dfrac{e^{-i\phi}(1+\beta\alpha)+(z-\alpha)r}{r e^{-i\phi}(1+\beta\alpha)-(z-\alpha)}\right|<r$$ where $r=R+\sqrt{1+R^2}$.

Semiclassical
  • 15,842