How to efficiently determine which point of spherical octahedron is closest

138 Views Asked by At

Given the following spherical octahedron with 3 grid points and one point p randomly within the 1-2-3 tile

enter image description here

how do I determine which of the points 1, 2, or 3 is geodesically closest to p without computing scalar products? I am actually interested in the scalar product of p with the closest point only. This is part of an algorithm where the evaluation of the scalar product is a bottleneck, so I wonder if there is some tweak to that.

1

There are 1 best solutions below

0
On BEST ANSWER

I'll assume point $P$ given by its latitude $\lambda$ and longitude $\phi$, point $1$ being located at $\lambda=90°$, point $2$ at $\lambda=0°$ and $\phi=0°$, point $3$ at $\lambda=0°$ and $\phi=90°$.

The center $O$ of the triangle has coordinates $(1/\sqrt3,1/\sqrt3,1/\sqrt3)$ corresponding to $\lambda=\arcsin(1/\sqrt3)$ and $\phi=45°$. Joining $O$ with the centers $M$, $H$, $N$ of arcs $12$, $23$, $31$ respectively, we can divide the triangle into three sectors: finding which vertex is the nearest to $P$ is the same as finding to which sector $P$ belongs.

The greatest circle arc $OM$ is formed by points with longitude $0°\le\phi\le45°$ and latitude $\theta=\arctan(\cos\phi)$, while arc $ON$ is formed by points with longitude $45°\le\phi\le90°$ and latitude $\theta=\arctan(\sin\phi)$.

We conclude then that point $P$ is:

  • nearest to vertex $2$ if $0°\le\phi\le45°$ and $0°\le\theta\le\arctan(\cos\phi)$;

  • nearest to vertex $3$ if $45°\le\phi\le90°$ and $0°\le\theta\le\arctan(\sin\phi)$;

  • nearest to vertex $1$ otherwise.