How do I find the orthogonal projection of a point onto a plane
Show older comments
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?
2 Comments
Andrew Newell
on 16 Mar 2015
That's a math question. If you tell us the formula, we can tell you how to implement it.
luc
on 23 Mar 2015
Accepted Answer
More Answers (2)
Noah
on 3 Oct 2019
This is an old post, but it deserves a simpler answer. Your plane is spanned by vectors A and B, but requires some point in the plane to be specified in 3D space. Call a point in the plane P. You can compute the normal (call it "n" and normalize it). Then the projection of C is given by translating C against the normal direction by an amount dot(C-P,n).
% compute the normal
n = cross(A, B) ;
n = n / sqrt(sum(n.^2)) ;
% project onto the plane
C_proj = C - dot(C - P, n) * n
3 Comments
NGOC TAM LAM
on 23 Apr 2020
How can you express P in the formula?
Nadezhda Lapina
on 7 May 2021
Edited: Nadezhda Lapina
on 7 May 2021
P is any point that belongs to the plane
Brent F
on 17 Jun 2021
can also use norm:
n = n / norm(n)
canadarunner
on 15 May 2024
The vectorized version would be simply just
C_proj = C - (C - P) * n' * n;
Categories
Find more on Lengths and Angles in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!