We can define a stereographic projection by
$$f(x_1,x_2,x_3)=\frac{x_1+ix_2}{1-x_3}$$
It is said the inverse of f can be computed to receive the general point where the line intersects the sphere. However I am struggling to understand how to find the inverse of a 3 variable function.
Let $$\frac{x_1+ix_2}{1-x_3}=a+ib$$ Then $$x_1+ix_2=(1-x_3)(a+ib)$$ Hence $$1=x_1^2+x^2_2+x_3^2=(a^2+b^2)(1-x_3)^2+x_3^2$$ which implies $$(a^2+b^2)(1-x_3)=1+x_3.$$ Now we can solve for $x_3.$