Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Perpendicular Vector of a plane with a lot of points

Subject: Perpendicular Vector of a plane with a lot of points

From: Carlos Junior

Date: 23 Jun, 2011 05:26:02

Message: 1 of 4

Hi,
Please, if anyone could help me I would be very grateful...

I have more than three 3-D points in a plane distribution and I need to know the perpendicular vector of this plane ... In my case, I have 36 points at the 3-D space... They are at the same plane... How could I know the perpendicular vector to this plane using all the points and not only three points ?

Very Thanks.

Carlos

Subject: Perpendicular Vector of a plane with a lot of points

From: Roger Stafford

Date: 23 Jun, 2011 06:27:04

Message: 2 of 4

"Carlos Junior" <carlosjunior@gmail.com> wrote in message <ituipa$n3l$1@newscl01ah.mathworks.com>...
> Hi,
> Please, if anyone could help me I would be very grateful...
>
> I have more than three 3-D points in a plane distribution and I need to know the perpendicular vector of this plane ... In my case, I have 36 points at the 3-D space... They are at the same plane... How could I know the perpendicular vector to this plane using all the points and not only three points ?
>
> Very Thanks.
>
> Carlos
- - - - - - - - -
  The answer to your question depends on how much validity is to be attributed to your statement "They are at the same plane". If this statement is literally and exactly true, then there is absolutely no point in using any more than three of the points to find an orthogonal direction. Any three which are non-colinear will do.

  On the other hand if the points lie only approximately in a plane, then there is suddenly an urgent need to use all of the points to get the best possible answer.

  For the exactly planar case, let P, Q, and R be any three (non-colinear) points. Then cross(Q-P,R-P) is a vector which is orthogonal to the plane of the points. End of story.

  For the approximately planar case, you can make use of the 'mean' and 'svd' functions, but I will hold off until I hear that you are interested in this possibility.

Roger Stafford

Subject: Perpendicular Vector of a plane with a lot of points

From: Carlos Junior

Date: 23 Jun, 2011 06:41:04

Message: 3 of 4

"Roger Stafford" wrote in message <itumbo$27s$1@newscl01ah.mathworks.com>...
> "Carlos Junior" <carlosjunior@gmail.com> wrote in message <ituipa$n3l$1@newscl01ah.mathworks.com>...
> > Hi,
> > Please, if anyone could help me I would be very grateful...
> >
> > I have more than three 3-D points in a plane distribution and I need to know the perpendicular vector of this plane ... In my case, I have 36 points at the 3-D space... They are at the same plane... How could I know the perpendicular vector to this plane using all the points and not only three points ?
> >
> > Very Thanks.
> >
> > Carlos
> - - - - - - - - -
> The answer to your question depends on how much validity is to be attributed to your statement "They are at the same plane". If this statement is literally and exactly true, then there is absolutely no point in using any more than three of the points to find an orthogonal direction. Any three which are non-colinear will do.
>
> On the other hand if the points lie only approximately in a plane, then there is suddenly an urgent need to use all of the points to get the best possible answer.
>
> For the exactly planar case, let P, Q, and R be any three (non-colinear) points. Then cross(Q-P,R-P) is a vector which is orthogonal to the plane of the points. End of story.
>
> For the approximately planar case, you can make use of the 'mean' and 'svd' functions, but I will hold off until I hear that you are interested in this possibility.
>
> Roger Stafford

------------------------

Hi Roger,
Thank you by the answer ... Indeed, I need the second situation you have cited:
" For the approximately planar case, you can make use of the 'mean' and 'svd' functions" ...

I have an ideal situation using the 3D Studio Max and MatLab to test the theory ... But, the project is also done at the real world where the points are not exactly at the same plane! Thus, what I need is to know how to find a perpendicular vector to the "approximately planar case" ...

Very thanks,

Carlos

Subject: Perpendicular Vector of a plane with a lot of points

From: Roger Stafford

Date: 23 Jun, 2011 07:12:02

Message: 4 of 4

"Carlos Junior" <carlosjunior@gmail.com> wrote in message <itun60$45e$1@newscl01ah.mathworks.com>...
> Hi Roger,
> Thank you by the answer ... Indeed, I need the second situation you have cited:
> " For the approximately planar case, you can make use of the 'mean' and 'svd' functions" ...
>
> I have an ideal situation using the 3D Studio Max and MatLab to test the theory ... But, the project is also done at the real world where the points are not exactly at the same plane! Thus, what I need is to know how to find a perpendicular vector to the "approximately planar case" ...
>
> Very thanks,
>
> Carlos
- - - - - - - - -
  Let A be an n by 3 matrix where each row is one of the n points (that are approximately planar.)

 A0 = bsxfun(@minus,A,mean(A,1)); % Subtract "mean" point
 [~,~,V] = svd(A0,0);
 p = V(:,3); % Choose the eigenvector with the smallest singular value

Then 'p' is a unit vector orthogonal to the least squares best-fitting plane to the n points. This best plane passes through the point mean(A,1).

Roger Stafford

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us