MATLAB: How to find the orthogonal projection of a point onto a plane

orthogonalplanepointprojection

Say I have a plane spanned by two vectors A and B. I have a point C=[x,y,z], I want to find the orthogonal projection of this point unto the plane spanned by the two vectors. How do I do this?

Best Answer

min: (x0+lambda*a0+mu*b0-x)^2 + (y0+lambda*a1+mu*b1-y)^2 + (z0+lambda*a2+mu*b2-z)^2
gives the distance squared from the point (x,y,z) to the plane
w=(x0,y0,z0)+lambda*(a0,a1,a2)+mu*(b0,b1,b2).
Differentiate the distance squared with respect to lambda and mu, set the partial derivatives to 0 and solve for lambda and mu.
If the result is lambda^, mu^, then
(x0,y0,z0)+(lambda^)*(a0,a1,a2)+(mu^)*(b0,b1,b2)
is the orthogonal projection of (x,y,z) onto the plane.
Best wishes
Torsten.