
Algebra PreAlgebra and Basic Algebra Math Forum 
 LinkBack  Thread Tools  Display Modes 
February 26th, 2011, 03:45 PM  #1 
Newbie Joined: Jun 2009 Posts: 20 Thanks: 0  How do I tell if a point is inside a box?
Okay let's say I have an arbitrarily located and oriented (rotation) box in 3D space. I know the location of the eight points that make up this box (recalculated for translation and rotation). I also know the location of another point that isn't part of the box. How can I tell if this point is inside or outside of the box?

February 27th, 2011, 12:35 PM  #2 
Global Moderator Joined: May 2007 Posts: 6,710 Thanks: 675  Re: How do I tell if a point is inside a box?
It takes a little work. You need to set up the six sides of the box. Then set up a straight line through the test point and mark the location of the test point as the zero of the line. Locate the crossing points of this line with the planes of the box sides and count those where the crossing is inside the side, and the distance from the test point to the crossing along the line is > 0. If the number of crossings is even, the test point is outside, if odd, it is inside. Be careful to avoid the box edges, since this could lead to ambiguity. Also if the test point is on the surface of the box, (the distance to a crossing is 0), decide what you want.

February 28th, 2011, 11:27 AM  #3 
Member Joined: Jan 2011 Posts: 36 Thanks: 0  Re: How do I tell if a point is inside a box?
Alternatively I'm pretty sure you could apply the transformations that took you from the cube centered at (0,0,0) to your rotated/translated cube and apply the inverse to the points and see if they lay within the cube centered at (0,0,0) which will be much easier to look at.


Tags 
box, inside, point 
Search tags for this page 
math a point into a box,point inside or outside the cube,point in a box,is the point inside rotated cube,point within a box inventor,point inside cube test,Www.mathsisevrything.com,is a point within a box,check if point is inside 3d box,how to find a point is inside the box
Click on a term to search for related topics.

Thread Tools  
Display Modes  

Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Drawing a line from point a,b .. coords point b unkown  Vibonacci  Algebra  5  September 17th, 2012 12:28 AM 
Specific point inside a polygon  Akademicki  Algebra  0  November 2nd, 2010 10:43 AM 
point inside line segment or not  mathsiseverything  Algebra  5  April 8th, 2008 09:20 PM 
calculating point of line given starting point, slope  mathsiseverything  Algebra  1  March 4th, 2008 06:41 AM 
Point inside a pentagon  Guilherme142857  Algebra  2  October 11th, 2007 02:08 AM 