app/src/main/java/com/example/administrator/newmovie/Utils/Geometry.java
/**
     * Check if line segment first touches or crosses the line that is
     * defined by line segment second.
     *
     * @param a line segment interpreted as line
     * @param b line segment
     * @return <code>true</code> if line segment first touches or
     * crosses line second,
     * <code>false</code> otherwise.
     */
Check if line segment first touches or crosses the line that is
defined by line segment second.

@param a line segment interpreted as line
@param b line segment
@return true if line segment first touches or
crosses line second,
false otherwise.
Check if line segment first touches or crosses the line that is defined by line segment second . @param a line segment interpreted as line @param b line segment @return true if line segment first touches or crosses line second false otherwise .
public static boolean lineSegmentTouchesOrCrossesLine(LineSegment a,
                                                          LineSegment b) {
        return isPointOnLine(a, b.first)
                || isPointOnLine(a, b.second)
                || (isPointRightOfLine(a, b.first) ^ isPointRightOfLine(a,
                b.second));
    }
public static boolean lineSegmentTouchesOrCrossesLine ( LineSegment a , LineSegment b ) { return isPointOnLine ( a , b . first ) || isPointOnLine ( a , b . second ) || ( isPointRightOfLine ( a , b . first ) ^ isPointRightOfLine ( a , b . second ) ) ; }
Check if line segment first touches or crosses the line that is
 defined by line segment second.
Check if line segment first touches or crosses the line that is defined by line segment second .