code: function(p1, p2) {
  
              return (p1 && p2) ? (((p2.x - this.x) * (p1.y - this.y)) - ((p2.y - this.y) * (p1.x - this.x))) : NaN;
          }
docs: Returns the cross product of this point relative to two other points this point is the common point point p1 lies on the first vector, point p2 lies on the second vector watch out for the ordering of points p1 and p2! positive result indicates a clockwise ("right") turn from first to second vector negative result indicates a counterclockwise ("left") turn from first to second vector note that the above directions are reversed from the usual answer on the Internet that is because we are in a left-handed coord system (because the y-axis points downward)