private static boolean isPointInPolygon(Point p, Point[] v )
	{
		int wn = 0;
		for (int j = 0, i = v.length-1; j < v.length; i = j++) {
			if (v[i].y <= p.y) {
				if(v[j].y > p.y) {
					if (isLeft(v[i],v[j],p) > 0)
						++wn;
				}
			} else {
				if(v[j].y <= p.y) {
					if (isLeft(v[i],v[j],p) < 0)
						--wn;
				}
			}
		}
		return wn != 0;
	}
private static boolean isPointInPolygon(Point p, Point[] v )
	{
		int wn = 0;
		for (int j = 0, i = v.length-1; j < v.length; i = j++) {
			if (v[i].y <= p.y) {
				if(v[j].y > p.y) {
					if (isLeft(v[i],v[j],p) > 0)
						++wn;
				}
			} else {
				if(v[j].y <= p.y) {
					if (isLeft(v[i],v[j],p) < 0)
						--wn;
				}
			}
		}
		return wn != 0;
	}
private static boolean isPointInPolygon ( Point p , Point [ ] v ) { int wn = 0 ; for ( int j = 0 , i = v . length - 1 ; j < v . length ; i = j ++ ) { if ( v [ i ] . y <= p . y ) { if ( v [ j ] . y > p . y ) { if ( isLeft ( v [ i ] , v [ j ] , p ) > 0 ) ++ wn ; } } else { if ( v [ j ] . y <= p . y ) { if ( isLeft ( v [ i ] , v [ j ] , p ) < 0 ) -- wn ; } } } return wn != 0 ; }
http://geomalgorithms.com/a03-_inclusion.html
http : // geomalgorithms . com / a03 - _inclusion . html