Everything that you do effectively “uses line equations”, so I'm not sure what to do with this condition. I suppose you just want simple inequalities to check what area the random point is in (x,y), so I'll show you how to do it.
, , , , (0,0), (a,b), (c,d) (a+c,b+d), . , , (a,b) "" (0,0) (c,d) "" (0,0). "" -bx+ay=0 -bx+ay=-bc+ad, , , -bx+cy 0 -bc+ad:
// Assuming -bc+ad is positive
-bx+ay < 0 // it in the "bottom row"
0 < -bx+ay < -bc+ad // it in the "middle row"
-bc+ad < -bx+ay // it in the "top row"
, "" dx-cy=0 dx-cy=da-bc, , , dx-cy 0 da-cb:
// Still assuming ad-bc is positive
dx-cy < 0 // it in the "left column"
0 < dx-cy < da-cb // it in the "middle column"
da-cb < dx-cy // it in the "right column"
, da-cb , " da-cb", " da-cb 0" ", 0". , , (x,y) , .