Could someone please explain the formula behind this, and then provide an example of how to do this? Basically I have 4 points, each with a longitude and latitude number. (They make a polygon quad, so a square or rectangle, in the shape of two triangles.) I then have a user's point. This is their location, also in the form of latitude and longitude coordinates. What is the process I need to determine if that point is INSIDE the square (or two triangles)?
For example, I may have four points:
Point A: x = 5, y = 0
Point B: x = 10, y = 0
Point C: x = 4, y = 3
Point D: x = 10, y = 3
User Point Z: x = 7, y = 2
If I were to draw this out on a graph, I can see that "Z" is clearly inside the polygon. However, how can I prove this with math, rather than relying on graph paper?