Given a plane and a point, how can I determine which side of the plane the point is on?

PingSpike

Lifer
Feb 25, 2004
21,756
600
126
I have a plane, a polygon really. I know the coordinates of all the vertices. And the normal of the polygon. And I have the coordinates of a point. How can I tell which side of the plane of the polygon the point is on.

The broader implication if you're interested is that I need to determine if a point is within a sector. (A 3d shape made out of non-concave polygons) I figured that if I iterated through all the faces/sides of the shape, if the point was on the interior facing side of all of them that I could determine that it was inside the shape. If it was not, it was outside of it.
 

lousydood

Member
Aug 1, 2005
158
0
0
dot-product sounds useful to you. A dot B = |A||B|cos Theta, or so. It's easy to compute, just being the sum of the components multiplied together.

Dot-product between the normal vector and the vector from the plane to the point should tell you the angle. Even more simply, you can tell if it's acute, right, or obtuse if the dot-product is negative, 0, or positive (hope I have that in the right order).
 

PingSpike

Lifer
Feb 25, 2004
21,756
600
126
So, then
if "point to test" dot "plane normal" > "point on plane" dot "plane normal" then

its on the same side as the normal, or < its on the otherside?
 

esun

Platinum Member
Nov 12, 2001
2,214
0
0
(point to test) dot (plane normal) = 0 => Point is on the plane

(point to test) dot (plane normal) > 0 => Point is on the same side as the normal vector

(point to test) dot (plane normal) < 0 => Point is on the opposite side of the normal vector

This is because a*b = 0 implies the angle between a and b is 90 degrees. a*b > 0 implies the angle is less than 90 degrees. a*b < 0 implies it is greater than 90 degrees (this is what lousydood was referring to).

(point on plane) dot (plane normal) will always be 0, by the way, since they are orthogonal.