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

# Thread Subject: Finding points in a parallelepiped

 Subject: Finding points in a parallelepiped From: M Date: 30 Sep, 2010 22:53:04 Message: 1 of 2 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
 Subject: Finding points in a parallelepiped From: Roger Stafford Date: 30 Sep, 2010 23:10:20 Message: 2 of 2 "M " wrote in message ... > 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