# project a point in 3D on a given plane

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.

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$$

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).

• Can one not accept more than one as answers? Thanks for your explanation. – Tem Pora Jul 22 '13 at 5:01
• You can accept only one answer. But you can upvote several answers, if you want to. And, you can upvote in addition to accepting, if you want to. – bubba Jul 22 '13 at 7:27

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$.

• How would this be done, for example, if I have the orthogonal vectors for each plane and want to project a point on one plane, down its plane normal to the other, given that the vector space for each plane is similar and each has a selected origin? I can ask a new question if you think that would be best. – Nolo Jul 15 '16 at 20:47
• I think what I actually need is the situation where I know R, but P is unknown, but like I said in the previous comment, I know the orientation of the plane that P is in. – Nolo Jul 16 '16 at 2:29