Stereographic projection
To get the coordinates of the point $Q$ from those of the point $P$ consider the
two similar triangles (on the right). By comparing the vertical sides of these
triangles we see that the larger one is $1/(1-y_3)$ times as large as the
smaller one. Thus the distances from $Q$ and $P$ to the vertical axis satisfy
$r' = r/(1-y_3)$.
Projection of $S^{n-1}$ onto $\R^{n-1}$
Stereographic projection maps all points on the sphere except the North Pole
onto the plane through the equator. If $P(y_1, y_2, \dots, y_n)$ is the point
on the sphere and if $(z_1, z_2, \dots, z_{n-1})$ is its image then
\[
z_1 = \frac{y_1}{1-y_n}, \quad
z_2 = \frac{y_2}{1-y_n}, \quad
\dots\quad
z_{n-1} = \frac{y_{n-1}}{1-y_n}.
\]
Derivation
The stereographic projection is constructed as follows: given a point $P(y_1,
y_2, \dots, y_n)$ on the sphere with radius $1$ form the line through the North
Pole $N(0,\dots, 0,1)$ and $P$.
The parametric representation of this line is
\[
Z = N + t\,\vec{NP} =
\begin{pmatrix}
ty_1\\ ty_2\\ \vdots \\ ty_{n-1} \\ 1 + t(y_n-1)
\end{pmatrix}
\]
This line intersects the hyperplane $z_n=0$ when $1+t(y_n-1)=0$. Thus at the
intersection point we have $t=1/(1-y_n)$ and thus the intersection point is
\[
Z =
\begin{pmatrix}
y_1/(1-y_n)\\ y_2/(1-y_n)\\ \vdots \\ y_{n-1}/(1-y_n) \\ 0
\end{pmatrix}
\]