Let xc be a point on S2. This induces a notion of greatcircle distance, which is
the length of a geodesic connecting some arbitrary point x∈S2.
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(xc⋅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 that is the center of
our coordinate system and some xo=−xc which induces a reference geodesic with
respect to which we can calculate the phase of any point on Y≡S2∖{xc,−xc}.
Let x∈Y. Then the triple (xc,xo,x) forms a triangle on the sphere,
which we can use to do trigonometry. Our phase is essentially∢xoxcx.
Let xo⊥ be the point resulting from rotating xc 90º ccw about xo.
This can be constructed as
R=⎣⎡ux2(1−cosθ)+cosθuxuy(1−cosθ)+uzsinθuxuz(1−cosθ)−uysinθuxuy(1−cosθ)−uzsinθuy2(1−cosθ)+cosθuyuz(1−cosθ)+uxsinθuxuz(1−cosθ)+uysinθuyuz(1−cosθ)−uxsinθuz2(1−cosθ)+cosθ⎦⎤
The sign of xo⊥⋅x indicates whether to add π to ∢xoxcx
Spherical trig should give the angle value.
What then happens if we let x=rcosθ,y=rsinθ? 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.