My Math Forum How do I tell if a point is inside a box?

 Algebra Pre-Algebra and Basic Algebra Math Forum

 February 26th, 2011, 04: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, 01:35 PM #2 Global Moderator   Joined: May 2007 Posts: 6,642 Thanks: 625 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, 12:27 PM #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

,

,

,

,

,

,

,

,

,

### how to find a point is inside the box

Click on a term to search for related topics.
 Thread Tools Display Modes Linear Mode

 Similar Threads Thread Thread Starter Forum Replies Last Post Vibonacci Algebra 5 September 17th, 2012 01:28 AM Akademicki Algebra 0 November 2nd, 2010 11:43 AM mathsiseverything Algebra 5 April 8th, 2008 10:20 PM mathsiseverything Algebra 1 March 4th, 2008 07:41 AM Guilherme142857 Algebra 2 October 11th, 2007 03:08 AM

 Contact - Home - Forums - Cryptocurrency Forum - Top