src/geometry.js
function(p) {

        var start = this.start;
        var end = this.end;

        if (start.cross(p, end) !== 0) return false;
        // else: cross product of 0 indicates that this line and the vector to `p` are collinear

        var length = this.length();
        if ((new g.Line(start, p)).length() > length) return false;
        if ((new g.Line(p, end)).length() > length) return false;
        // else: `p` lies between start and end of the line

        return true;
    }
function(p) {

        var start = this.start;
        var end = this.end;

        if (start.cross(p, end) !== 0) return false;
        // else: cross product of 0 indicates that this line and the vector to `p` are collinear

        var length = this.length();
        if ((new g.Line(start, p)).length() > length) return false;
        if ((new g.Line(p, end)).length() > length) return false;
        // else: `p` lies between start and end of the line

        return true;
    }
function ( p ) { var start = this . start ; var end = this . end ; if ( start . cross ( p , end ) !== 0 ) return false ; // else: cross product of 0 indicates that this line and the vector to `p` are collinear var length = this . length ( ) ; if ( ( new g . Line ( start , p ) ) . length ( ) > length ) return false ; if ( ( new g . Line ( p , end ) ) . length ( ) > length ) return false ; // else: `p` lies between start and end of the line return true ; }
Returns `true` if the point lies on the line.
Returns true if the point lies on the line .