Solution (source code)

= Solution

The line through the north <pole> and $p=(a,b,c)$ is
$$
(0,0,1)+t(a,b,c-1).
$$
Its intersection with the equatorial complex plane has third coordinate zero, giving $t=1/(1-c)$ when $p$ is not the north <pole>. The first two coordinates are therefore $a/(1-c)$ and $b/(1-c)$, hence
$$
\boxed{\pi(a,b,c)=\frac{a+bi}{1-c}.}
$$
The north <pole> maps to the point at infinity. This is <stereographic projection> onto the <Riemann sphere>.