|
"M " <m_@gmail.com> wrote in message <i834cg$kal$1@fred.mathworks.com>...
> 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?
> Thanks in advance for your help.
> - Mary
- - - - - - - -
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:
d1 <= a*x + b*y + c*z <= d2
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.
Roger Stafford
|