code: 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;
      }
docs: Returns `true` if the point lies on the line.