app/src/main/java/com/example/administrator/newmovie/Utils/Geometry.java
/**
     * Checks if a Point is on a line
     *
     * @param a line (interpreted as line, although given as line
     *          segment)
     * @param b point
     * @return <code>true</code> if point is on line, otherwise
     * <code>false</code>
     */
Checks if a Point is on a line
@param a line (interpreted as line, although given as line
segment)
@param b point
@return true if point is on line, otherwise
false
Checks if a Point is on a line @param a line ( interpreted as line although given as line segment ) @param b point @return true if point is on line otherwise false
public static boolean isPointOnLine(LineSegment a, Point b) {
        LineSegment aTmp = new LineSegment(new Point(0, 0), new Point(
                a.second.x - a.first.x, a.second.y - a.first.y));
        Point bTmp = new Point(b.x - a.first.x, b.y - a.first.y);
        double r = crossProduct(aTmp.second, bTmp);
        return Math.abs(r) < EPSILON;
    }
public static boolean isPointOnLine ( LineSegment a , Point b ) { LineSegment aTmp = new LineSegment ( new Point ( 0 , 0 ) , new Point ( a . second . x - a . first . x , a . second . y - a . first . y ) ) ; Point bTmp = new Point ( b . x - a . first . x , b . y - a . first . y ) ; double r = crossProduct ( aTmp . second , bTmp ) ; return Math . abs ( r ) < EPSILON ; }
Checks if a Point is on a line
 @param a line (interpreted as line, although given as line
          segment)
 @param b point
 @return <code>true</code> if point is on line, otherwise
 <code>false</code>
Checks if a Point is on a line @param a line ( interpreted as line although given as line segment ) @param b point @return <code > true< / code > if point is on line otherwise <code > false< / code >
// Move the image, so that a.first is on (0|0)