code: function(p) {
          var v = this.b.sub(this.a);
          var t = p.sub(this.a).dot(v) / v.magSquared();
          // Check to see if t is beyond the extents of the line segment
          if (t < 0.0) {
              return this.a.copy();
          } else if (t > 1.0) {
              return this.b.copy();
          }
          // Return the point between 'a' and 'b'
          return this.a.add(v.scaleSelf(t));
      }
docs: Computes the closest point on this line to the given one.
  
  @param p
  point to check against
  @return closest point on the line