Got Questions? Get Answers.
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:
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 " <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

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