project a point in 3D on a given plane

14.8k Views Asked by At

A point in a 3D space is given as $ P(x,y,z) $. I want to find the position of this point projected parallel to the normal on a plane Q defined by $3$ non-collinear points $ Q1(x1,y1,z1), Q2(x2,y2,z2)\; and \;Q3(x3,y3,z3) $.

How to derive this point of projection?

I saw this entry on Wikipedia but I cannot understand it.

I'd prefer an answer that gives the derivation of a $4$-ary transformation function $f$ such that

$ f \; (P, Q1, Q2, Q3) = P' $

where P' is a point in 2D with co-ordinates as $ P'(x',y') $ such that P' is the required projection of P on the plane Q.

3

There are 3 best solutions below

0
On BEST ANSWER

Let $Q_1$, $Q_2$ and $Q_3$ be linearly independent vectors. The formula $$ n=\frac{(Q_2-Q_1)\times(Q_3-Q_2)}{|(Q_2-Q_1)\times(Q_3-Q_2)|} $$ defines a unit vector normal to the plane. Let $P$ be a vector, and $\pi(P)$ its normal projection onto the plane. Then, $$ P-\pi(P)=D\,n $$ for some $D\in\mathbb{R}$. Keeping in mind that $n$ is orthogonal to the plane, we can write $$ D=(P-\pi(P))\cdot n=(P-\pi(P))\cdot n+(\pi(P)-Q_1)\cdot n=(P-Q_1)\cdot n $$ Finally, we have: $$ \pi(P)=P-\left((P-Q_1)\cdot n\right)n $$

2
On

Let $U = Q_2 - Q_1$ and $V = Q_3 - Q_1$, and let $R$ be the required projected point. Then, since $R$ lies in the plane of $Q_1$, $Q_2$, $Q_3$, there exist numbers $h$ and $k$ such that $$R = Q1 + h*U + k*V$$ The vector $R-P$ is perpendicular to the plane, so $(R-P) \cdot U = 0$ and $(R-P) \cdot V = 0$. Substituting for $R$ gives: $$ (Q1 + h*U + k*V- P) \cdot U = 0 \\ (Q1 + h*U + k*V- P) \cdot V = 0 $$ which expands to $$ h*(U \cdot U) + k*(U \cdot V) = (Q1-P) \cdot U \\ h*(U \cdot V) + k*(V \cdot V) = (Q1-P) \cdot V $$ Solve these equations for $h$ and $k$ (by Cramer's rule, for example), and then substitute into the first displayed equation above to get $R$.

2
On

Alternatively ...

Define $U$, $V$ as in my first answer. Let $N$ be a unit vector normal to the plane, which you can obtain by unitizing the cross product $U \times V$.

Then the projected point $R$ is given by $$ R = P - \left[(P-Q_1) \cdot N\right]*N $$

This is essentially the same answer provided by zuggg. I wrote it before seeing his, and decided to keep it since I think it's easier to read. You can decide which one you like better, and how to give credit (if any).