http://www.mathworks.com/matlabcentral/newsreader/view_thread/286618
MATLAB Central Newsreader  Calculate whether a point is above or below a plane
Feed for thread: Calculate whether a point is above or below a plane
enus
©19942014 by MathWorks, Inc.
webmaster@mathworks.com
MATLAB Central Newsreader
http://blogs.law.harvard.edu/tech/rss
60
MathWorks
http://www.mathworks.com/images/membrane_icon.gif

Sun, 11 Jul 2010 07:13:10 +0000
Calculate whether a point is above or below a plane
http://www.mathworks.com/matlabcentral/newsreader/view_thread/286618#761608
Ian Pereira
Does anyone know an efficient algorithm to check if a 3D point lies above or below a plane?<br>
<br>
I believe Yamaguchi has an algorithm, but I am not sure if it can be implemented into Matlab efficiently.<br>
<br>
Tx.

Sun, 11 Jul 2010 08:04:06 +0000
Re: Calculate whether a point is above or below a plane
http://www.mathworks.com/matlabcentral/newsreader/view_thread/286618#761614
Roger Stafford
"Ian Pereira" <pereirai@rogers.com> wrote in message <i1bqu5$ig2$1@fred.mathworks.com>...<br>
> Does anyone know an efficient algorithm to check if a 3D point lies above or below a plane?<br>
> <br>
> I believe Yamaguchi has an algorithm, but I am not sure if it can be implemented into Matlab efficiently.<br>
> <br>
> Tx.<br>
      <br>
It would depend on what is meant by "above" and "below". On the (almost) spherical earth, what is above a great circle plane and what is below it? Which way is up?<br>
<br>
If you consider the zaxis as being the up and down axis, then what would you say about a plane that is orthogonal to the xy plane?<br>
<br>
If a plane in an xyz cartesian coordinate system is characterized by the equation<br>
<br>
a*x+b*y+c*z+d = 0<br>
<br>
then a point with coordinates x, y, and z, lies to one side of the plane in accordance with the sign of a*x+b*y+c*z+d. Positive, it is on one side; negative, it is on the opposite side; and zero, it lies right on the plane. However, which side is which depends on the particular coeffficients selected for a, b, c, and d. If one reverses all their signs, then the above criterion reverses even though the plane is the same.<br>
<br>
Roger Stafford

Sun, 11 Jul 2010 09:36:05 +0000
Re: Calculate whether a point is above or below a plane
http://www.mathworks.com/matlabcentral/newsreader/view_thread/286618#761619
us
"Ian Pereira" <pereirai@rogers.com> wrote in message <i1bqu5$ig2$1@fred.mathworks.com>...<br>
> Does anyone know an efficient algorithm to check if a 3D point lies above or below a plane?<br>
> <br>
> I believe Yamaguchi has an algorithm, but I am not sure if it can be implemented into Matlab efficiently.<br>
> <br>
> Tx.<br>
<br>
this NG deals with ML language problems...<br>
<br>
us

Sun, 11 Jul 2010 14:51:04 +0000
Re: Calculate whether a point is above or below a plane
http://www.mathworks.com/matlabcentral/newsreader/view_thread/286618#761663
Jan Simon
Dear Ian,<br>
<br>
> Does anyone know an efficient algorithm to check if a 3D point lies above or below a plane?<br>
<br>
If you ask for "above or below", you obviously have defined a direction. This is usually the normal vector of the plane. To define the plane completely, you need also one point which is any element of the plane.<br>
<br>
The rest is easy: Measure the angle between 1. the vector from the point in your plane to the tested point and 2. the normal vector. How angles between vectors are measured efficiently has been discussed last week.<br>
<br>
Did you ask your teacher for help also?<br>
Jan

Mon, 12 Jul 2010 17:50:19 +0000
Re: Calculate whether a point is above or below a plane
http://www.mathworks.com/matlabcentral/newsreader/view_thread/286618#761906
Ian Pereira
"Jan Simon" <matlab.THIS_YEAR@nMINUSsimon.de> wrote in message <i1cloo$s4h$1@fred.mathworks.com>...<br>
> Dear Ian,<br>
> <br>
> > Does anyone know an efficient algorithm to check if a 3D point lies above or below a plane?<br>
> <br>
> If you ask for "above or below", you obviously have defined a direction. This is usually the normal vector of the plane. To define the plane completely, you need also one point which is any element of the plane.<br>
> <br>
> The rest is easy: Measure the angle between 1. the vector from the point in your plane to the tested point and 2. the normal vector. How angles between vectors are measured efficiently has been discussed last week.<br>
> <br>
> Did you ask your teacher for help also?<br>
> Jan<br>
<br>
Worked perfectly.<br>
<br>
The main issue was the sign convention that matlab used, but I worked it out with a few test cases.<br>
<br>
This was part of an algorithm to select all mesh vertices above a userselected plane in a 3D reconstruction and manipulation app. Currently I'm scrolling through all mesh vertices and using the angles to see if they are above or below the plane. As some meshes are rather large (>50k faces), this can be a bit timeconsuming, but at least it works now.

Mon, 12 Jul 2010 18:59:06 +0000
Re: Calculate whether a point is above or below a plane
http://www.mathworks.com/matlabcentral/newsreader/view_thread/286618#761930
Jan Simon
Dear Ian,<br>
<br>
If you have 50k points, you can rotate the 3D coordinates such that the normal vektor of the plane is parallel e.g. to the Zaxis.<br>
Then a simple >= operation of the Zcomponent of the points is enough to decide if they are over or under the plane.<br>
<br>
Jan