public static bool Contains(PointF point, PointF[] cornerPoints)
{
int intersections = 0;
for (int i = 1; i < cornerPoints.Length; ++i) {
if (DoesIntersects(point, cornerPoints[i], cornerPoints[i - 1]))
++intersections;
}
if (DoesIntersects(point, cornerPoints[cornerPoints.Length - 1], cornerPoints[0]))
++intersections;
return (intersections % 2 != 0);
}