def RiemannSphere(z):
    """Map the complex plane to Riemann's sphere via stereographic projection.
    """
    t = 1 + z.real * z.real + z.imag * z.imag
    return 2 * z.real / t, 2 * z.imag / t, 2 / t - 1