I have a set of X and Y points that builds a shape and I need to know if an object is inside it or not what is the calculation to it ?
X and Y coords example:
I've always done it like so:
Pick a point you know to be outside the shape.
Make a line between that point and the point you're trying to find whether it's inside the shape or not.
Count the number of sides of the shape the line crosses.
If the count is odd, the point is inside the shape.
If the count is even, the point is outside the shape.