Polar coordinates on sphere

Let xc\boldsymbol{x}_c be a point on S2 \mathbb{S}^2. This induces a notion of greatcircle distance, which is the length of a geodesic connecting some arbitrary point xS2 \boldsymbol{x} \in \mathbb{S}^2. For calculations we mostly use cartesian coordinates to reduce the algebra we need to do. This distance can be calculated as d(xc,x)=arccos(xcx) d(\boldsymbol{x}_c, \boldsymbol{x}) = \arccos(\boldsymbol{x}_c \cdot \boldsymbol{x}).

For the purposes of constructing high-quality topography that does not contain lat-lon artifacts (like in our BWTopo paper), I want to introduce the notion of phase, assuming we have some fixed xc \boldsymbol{x}_c that is the center of our coordinate system and some xoxc \boldsymbol{x}_o \neq -\boldsymbol{x}_c which induces a reference geodesic with respect to which we can calculate the phase of any point on YS2{xc,xc}\mathbb{Y} \equiv \mathbb{S}^2 \setminus \{\boldsymbol{x}_c, -\boldsymbol{x}_c\}.

Let xY\mathbb{x} \in \mathbb{Y}. Then the triple (xc,xo,x)(\boldsymbol{x}_c, \boldsymbol{x}_o, \boldsymbol{x}) forms a triangle on the sphere, which we can use to do trigonometry. Our phase is essentiallyxoxcx\sphericalangle \boldsymbol{x}_o \boldsymbol{x}_c \boldsymbol{x} . Let xo\boldsymbol{x}_o^\perp be the point resulting from rotating xc\boldsymbol{x}_c 90º ccw about xo\boldsymbol{x}_o. This can be constructed as R=[ux2(1cosθ)+cosθuxuy(1cosθ)uzsinθuxuz(1cosθ)+uysinθuxuy(1cosθ)+uzsinθuy2(1cosθ)+cosθuyuz(1cosθ)uxsinθuxuz(1cosθ)uysinθuyuz(1cosθ)+uxsinθuz2(1cosθ)+cosθ] R={\begin{bmatrix}u_{x}^{2}\left(1-\cos \theta \right)+\cos \theta &u_{x}u_{y}\left(1-\cos \theta \right)-u_{z}\sin \theta &u_{x}u_{z}\left(1-\cos \theta \right)+u_{y}\sin \theta \\ u_{x}u_{y}\left(1-\cos \theta \right)+u_{z}\sin \theta &u_{y}^{2}\left(1-\cos \theta \right)+\cos \theta &u_{y}u_{z}\left(1-\cos \theta \right)-u_{x}\sin \theta \\ u_{x}u_{z}\left(1-\cos \theta \right)-u_{y}\sin \theta &u_{y}u_{z}\left(1-\cos \theta \right)+u_{x}\sin \theta &u_{z}^{2}\left(1-\cos \theta \right)+\cos \theta \end{bmatrix}}

The sign of xox \boldsymbol{x}_o^\perp \cdot \boldsymbol{x} indicates whether to add π \pi to xoxcx\sphericalangle \boldsymbol{x}_o \boldsymbol{x}_c \boldsymbol{x} Spherical trig should give the angle value.

What then happens if we let x=rcosθ,y=rsinθ x = r\cos\theta, y=r\sin\theta? This still has lat-lon issues, but we've made a coordinate mullet that hides these problems at the antipode. For, e.g., compact topography, this is acceptable. Todo: make a colab notebook exploring how these coordinates look in practice.

Parent post: