I have a convex polygon (typically just a rotated square), and I know all of 4 points. How do I determine if a given point (yellow/green) is inside the polygon?
Say, x[] is the array of x points and y[] is the array of y points.
You are meant to return 1 if the point exists in the polygon and 2 if not. where (planeX,planeY) is the point you need to check.
//check like this
return new Polygon(x,y,x.length).contains(planeX, planeY)?1:2;