public static boolean doesLineIntersectPolygon(FrameConvexPolygon2DReadOnly polygon, FrameLine2DReadOnly line) { boolean onLeft = line.isPointOnLeftSideOfLine(polygon.getVertex(0)); for (int i = 0; i < polygon.getNumberOfVertices(); i++) { if (onLeft != line.isPointOnLeftSideOfLine(polygon.getVertex(i))) { return true; } } return false; }