Point on the left or right side of a plane in 3D space

18.8k Views Asked by At

I have an alpha plane determined by 3 points in space. How can I check if another point in space is on the left side of the plane or on the right side of it?

For example if the plane is determined by points $A(0,0,0)$, $B(0,1,0)$ and $C(0,0,1)$ then point $X(-1, 0, 0)$ is on the left side of the plane and point $Y(1,0,0)$ is on the right side of the plane.

I need a fast solution for plug-in development for a 3D application and I'm not very good at math.

plane

2

There are 2 best solutions below

6
On BEST ANSWER

Call the three points determining the plane $A$, $B$, $C$, and write $X$ for the new point. Form the three differences $B'=B-A$, $C'=C-A$, $X'=X-A$. Now compute the $3\times3$ determinant of the matrix whose columns (or rows, doesn't matter) are $B'$, $C'$, $X'$. The sign of the resulting determinant will be positive for $X$ on one side of the plane and negative on the other side.

Now you only need to figure out in general which side you want to call left and which side to call right.

0
On

I'm guessing from your comment that your planes intersect the $x$-axis in exactly one point, which determines the left and right sides.

Let $A,B,C$ be the points that determine the plane. Then the cross product $(B-A) \times (C-A)$ gives us a normal ${\bf n}$ to the plane. Now consider a test point $(x,0,0)$ where $x$ is a huge positive number. This should be on the right side of the plane. Now $((x,0,0) - A) \cdot {\bf n}$ is just the first coordinate of ${\bf n}$ times $x$ minus some constant. For large enough $x$ the sign of the dot product is then just the sign of the first coordinate of ${\bf n}$. Thus: If the sign of first coordinate of $n$ is positive, then the right side consists of the points $P$ with $(P - A) \cdot {\bf n} > 0$ and the left side consists of the points with $(P - A) \cdot {\bf n} < 0$. The inequalities are reversed if the sign of the first coordinate of $n$ is negative.