How do I find the orthogonal projection of a point onto a plane
Afficher commentaires plus anciens
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 commentaires
Andrew Newell
le 16 Mar 2015
That's a math question. If you tell us the formula, we can tell you how to implement it.
luc
le 23 Mar 2015
Réponse acceptée
Plus de réponses (2)
Noah
le 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 commentaires
NGOC TAM LAM
le 23 Avr 2020
How can you express P in the formula?
Nadezhda Lapina
le 7 Mai 2021
Modifié(e) : Nadezhda Lapina
le 7 Mai 2021
P is any point that belongs to the plane
Brent F
le 17 Juin 2021
can also use norm:
n = n / norm(n)
canadarunner
le 15 Mai 2024
The vectorized version would be simply just
C_proj = C - (C - P) * n' * n;
Catégories
En savoir plus sur Lengths and Angles dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!