[Math] Projection onto a plane

linear algebramap-projections

I was looking at this post ($3D$ projection onto a plane) in which the answer describes how to project a given set of points onto any arbitrary plane. However, this transformation is still of the form $\mathbb{R}^3 \to \mathbb{R}^3$ and I would like to obtain a transformation of the form $\mathbb{R}^3 \to \mathbb{R}^2$. Essentially, I would like to have a 2-D graph of the points in my plane. How can I do this?

Best Answer

If your points are $P_k(x_k,y_k,z_k)$ belonging to a plane orthogonal to normal vector $N(u,v,w)$, take two mutually orthogonal vectors. For example (unless $u$ and $v$ are both zero), you can take $P(v,-u,0)$ and $Q(u*w,v*w,-(u^2+v^2))$. normalize them (i.e., divide them by their norm) yielding vectors $Q'$ and $R'$. Then take all the dot products $x_k=Q'.P_k$ and $y_k=R'.P_k$ ; points $(x_k,y_k)$ will constitute your projected set of points.

Remarks: If you work with a software in which it is easy to program matrices, it suffices to "assemble" the 2 lines $\times$ 3 columns matrix $B$ having as its first line the coord. of $Q'$ and on its second line those of $R'$, and then multiply matrix $B$ by $C$ where $C$ is the $3$ lines and $n$ columns of the matrix whose $i$th column is constituted by the 3D coord. of the $k$th point in 3D.