# The closed form solution of a point on a plane

Given a plane in 3D Euclidean space is $\pi$: $ax+by+cz+d=0$ and a point $P$:$(X,Y,Z)\in \mathbb{R}^3$.

Find a point $Q:(X^*,Y^*,Z^*)\in \pi$ such that:

$$Q= \arg\min\limits_{Q^*\in\pi}\left\|P-Q\right\|$$

Is it difficult to find the closed form solution to $Q$?

• This question appears to be off-topic because it is about mathematics, not computational science. – Dr_Sam Mar 27 '14 at 6:55
• Q is the orthogonal projection of P onto that plane, you should be able to find the formula quite easily. – Dr_Sam Mar 27 '14 at 7:00
• This problem comes from computational geometry programming. Actually there is another similar problem from the same background: given two lines in 3D space, how to numerically determine whether they intersect or not. – LCFactorization Mar 27 '14 at 7:42
• @Dr_Sam do you have any clue in solving orthogonal projection of P? – LCFactorization Mar 27 '14 at 7:43
• That's another question then. For the projection, define the line orthogonal to $\pi$ passing by P (it's parallel to the normal direction of $\pi$). Then take the intersection of this line with the plane, and you have Q. – Dr_Sam Mar 27 '14 at 8:05

Given a plane $\pi: (a,b,c,d)$ , without loss of generality, let $a^2+b^2+c^2=1$, then the orthographic projection to $\pi$ in homogeneous matrix is: $$T=\left( \begin{array}{cccc} 1-a^2 & -a b & -a c & -a c \\ -a b & 1-b^2 & -b c & -b c \\ -a c & -b c & 1-c^2 & -c^2 \\ \end{array} \right)$$
If $P=(x,y,z,1)^T$, then the desired point $Q=T\cdot P$ is: $$\left\{\quad \begin{array}{c} \left(1-a^2\right) x-a b y-ac z -a c\\ -a b x+\left(1-b^2\right) y -b c z-b c\\ -a x c-b cy+\left(1-c^2\right) z -c^2\\ \end{array} \right.$$
• The orthographic projection's homogeneous matrix is obtained from a concept stereohomology – LCFactorization Mar 30 '14 at 1:07