I have 4 points that form some quadrilateral. The lines can't cross or anything like that, it should be a square, rectangle, rhombus, parallelogram, etc.
The lines that connect them break the field into 9 regions. With a square, it would look like a tic-tac-toe board (#), but with other shapes the lines will be at angles.
A point falls randomly into this 9-region field. I know the coordinates of the random point, as well as the coordinates of the quadrilateral's 4 corners.
Is there any way I can find which field contains the point without using the equations of the lines?
I'm basically looking for something like
if(p.x > q1.x && p.x < q4.x && p.y < q3.y) {
//It's in the top left region
}
etc
I'm thinking that this isn't possible when using sloped lines (rather than a square/rectangle) without solving the line equations. But I thought I'd run it by the math guys first. THANKS!