Check on which side of line point is I have a three numbers $ A, B, C $ which correspond to a line
$ Ax + By + C = 0 $
I have also points $ (p1, p2 ) $ and I want to separate those points depending on which side of the line they are. I know that any point lies exactly on this line.
Is it enough to check whether
$ A * p1 + B * p2 + C > 0 $ ?
If this is a true, how can I prove that it actually gives correct result ?
 A: If p = $(x_1, y_1)$ and 
$Ax_1 + By_1 + C = d > 0$.  Then the point p is directly $d/B$ distance away from the point $(x_1, y_1 - d/B)$ which is on the line.  (If B is positive p is above the line.  If B is negative p is below the line.)  The point p is also directly $d/A$ distance away from the point $(x_1 - d/B, y_1)$ which is on the line.  (If A is positive, p is to the right of the line.  If p is negative, p is to the left of the line.)
If $Ax_1 + By_1 + C = e < 0$ the point p is on the opposite side of the line.
This is assuming A and B are non zero.  If A is 0 then the line is horizontal and $By_1 + C >0 $ implies p is above the line.  If B = 0 then the line is vertical and $Ax_1 + C > 0$ implies p is to the right of the line.
A: We know the distance of a point(p,q) from a line $$a\cdot x+b\cdot y+ c=0$$ is $$(a\cdot p+b\cdot q+ c)/(a^2 + b^2)^{1/2}$$. The plus or minus sign will depend on whether the point is above or below the line. If we put the origin (0,0) in the above equation we will get the position of origin relative to the line. Now if a point P=(p,q), when put in the above equation has the same sign as the origin that implies the origin and point P lies on the same side of the line, if not otherwise. This explains why we check the sign of the above equation to determine a point's position relative to a line.
Now to distinguish two points according to a line, put the points in the above equation if they are of same sign they are on the same side relative to the line if they are of different signs they lie on different sides of the line.
I hope this helps. 
