http://www.mathworks.com/matlabcentral/newsreader/view_thread/292832
MATLAB Central Newsreader  Finding points in a parallelepiped
Feed for thread: Finding points in a parallelepiped
enus
©19942015 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

Thu, 30 Sep 2010 22:53:04 +0000
Finding points in a parallelepiped
http://www.mathworks.com/matlabcentral/newsreader/view_thread/292832#784159
M
I have a set of data (~ 5000 points) specified in 3 coordinates. I want to differentiate points that lie within a region from those that do not. My region is in the shape of a parallelepiped askew from the coordinate frame. I currently have my region described by a mesh of points covering the parallelepiped region's volume and have also easily identified the vertexes of parallelepiped. How do I determine if one of my data points lies within the boundaries of my parallelepiped region? I think I need, more or less, a 3D equivalent to the "inpolygon" function. Any ideas?<br>
Thanks in advance for your help.<br>
 Mary

Thu, 30 Sep 2010 23:10:20 +0000
Re: Finding points in a parallelepiped
http://www.mathworks.com/matlabcentral/newsreader/view_thread/292832#784165
Roger Stafford
"M " <m_@gmail.com> wrote in message <i834cg$kal$1@fred.mathworks.com>...<br>
> I have a set of data (~ 5000 points) specified in 3 coordinates. I want to differentiate points that lie within a region from those that do not. My region is in the shape of a parallelepiped askew from the coordinate frame. I currently have my region described by a mesh of points covering the parallelepiped region's volume and have also easily identified the vertexes of parallelepiped. How do I determine if one of my data points lies within the boundaries of my parallelepiped region? I think I need, more or less, a 3D equivalent to the "inpolygon" function. Any ideas?<br>
> Thanks in advance for your help.<br>
>  Mary<br>
       <br>
It should be relatively easy to do this for a parallelepiped. Its six faces are contained in three parallel pairs of planes, and the condition for a point lying between two parallel planes is of the form:<br>
<br>
d1 <= a*x + b*y + c*z <= d2<br>
<br>
This gives you six inequalities that must be satisfied by any point within the parallelepiped. You should be able to determine these coefficients from the eight vertices.<br>
<br>
Roger Stafford