Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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?

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

http://imageshack.us/a/img221/9009/46371495.png

Thanks

share|improve this question
    
How do you define right/left? –  chaohuang Oct 15 '12 at 10:54
    
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. Sorry for being inaccurate –  John Smith Oct 15 '12 at 11:03
1  
To distinguish the two sides of a plane, calculate a normal $n$ to it at some point $p$. Then a point $v$ is on the side where the normal points at if $(v-p) \cdot n > 0$ and on the other side if $(v-p) \cdot n < 0$. –  J. J. Oct 15 '12 at 11:05

2 Answers 2

up vote 5 down vote accepted

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.

share|improve this answer
    
Did the calculations on some examples and works. A big thanks! –  John Smith Oct 15 '12 at 11:16

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.