Solution (source code)

= Solution

For <stereographic projection>, choose the north pole $N=(0,0,1)$ of the <unit sphere> and identify the plane $Z=0$ with the <complex plane> by $z=X+iY$. Project a point $P=(X,Y,Z)\ne N$ along the line joining it to $N$; adjoin $z=\infty$ for the north pole to identify the whole <sphere> with the <Riemann sphere>. A point of that line is $N+t(P-N)$. Its last coordinate vanishes when $t=1/(1-Z)$, giving
$$
\boxed{z=\frac{X+iY}{1-Z}.}
$$
Using $X^2+Y^2+Z^2=1$, or solving this line's second intersection with the <sphere>, gives the inverse
$$
\boxed{X=\frac{2\operatorname{Re}z}{1+|z|^2},\quad Y=\frac{2\operatorname{Im}z}{1+|z|^2},\quad Z=\frac{|z|^2-1}{1+|z|^2}.}
$$
A <great circle> lies in a plane $h_1X+h_2Y+h_3Z=0$ through the origin. Its projected equation is
$$
2h_1\operatorname{Re}z+2h_2\operatorname{Im}z+h_3(|z|^2-1)=0.
$$
It is a straight line only if $h_3=0$, meaning the plane contains the north pole and the south pole. Thus if all three sides of a nondegenerate <spherical triangle> projected to straight sides of a Euclidean triangle, all three distinct side planes would contain both poles. Each pair of side planes could then meet on the <sphere> only at those same two poles, which cannot supply three distinct triangle vertices. \b[A nondegenerate <spherical triangle> cannot project to a Euclidean triangle.] If a side passes through the projection pole, its image is unbounded and also cannot be a finite triangle side.

A nonidentity <rotation in three dimensions> has an axis through the origin: an orthogonal three-by-three <matrix> of determinant one has an <eigenvalue> one, since nonreal <eigenvalues> pair as conjugates, real <eigenvalues> are $\pm1$, and their product is one. Its axis meets the <unit sphere> in an <antipodal pair>, which is fixed. In the identity case every point is fixed, so an <antipodal pair> can again be selected. Projecting $P$ and $-P$ gives
$$
p=\frac{X+iY}{1-Z},\qquad q=-\frac{X+iY}{1+Z},\qquad p\overline q=-\frac{X^2+Y^2}{1-Z^2}=-1
$$
whenever both points are finite. Thus the associated <Möbius transformation> fixes an <antipodal pair> satisfying the claimed relation. \b[The universally valid relation is $q=-1/\overline p$ on the <Riemann sphere>], with $0$ and $\infty$ paired. A rotation about the projection axis fixes exactly that pair, so the PDF's literal finite product needs this extended-coordinate convention. This is the <antipodal stereographic coordinate relation>.