필터 지우기
필터 지우기

How do I find the orthogonal projection of a point onto a plane

조회 수: 82 (최근 30일)
luc
luc 2015년 3월 16일
답변: canadarunner 2024년 5월 15일
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
Andrew Newell
Andrew Newell 2015년 3월 16일
That's a math question. If you tell us the formula, we can tell you how to implement it.
luc
luc 2015년 3월 23일
True, unfortunately I know how to implement it, but not the math.

댓글을 달려면 로그인하십시오.

채택된 답변

Torsten
Torsten 2015년 3월 23일
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.

추가 답변 (2개)

Noah
Noah 2019년 10월 3일
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
Nadezhda Lapina
Nadezhda Lapina 2021년 5월 7일
편집: Nadezhda Lapina 2021년 5월 7일
P is any point that belongs to the plane

댓글을 달려면 로그인하십시오.


canadarunner
canadarunner 2024년 5월 15일
The vectorized version would be simply just
C_proj = C - (C - P) * n' * n;

카테고리

Help CenterFile Exchange에서 Interpolation에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by