public static boolean convert ( LineGeneral2D_F64 [ ] lines , Polygon2D_F64 poly ) { for ( int i = 0 ; i < poly . size ( ) ; i ++ ) { int j = ( i + 1 ) % poly . size ( ) ; if ( null == Intersection2D_F64 . intersection ( lines [ i ] , lines [ j ] , poly . get ( j ) ) ) return false ; } return true ; }
Finds the intersections between the four lines and converts it into a quadrilateral