code: func (l *Line) Measure(point *Point) float64 {
  	projFactor := l.Project(point)
  	if projFactor <= 0.0 {
  		return 0.0
  	}
  	if projFactor <= 1.0 {
  		return projFactor * l.Distance()
  	}
  	// projFactor is > 1
  	return l.Distance()
  }
docs: // Measure returns the distance along the line to the point nearest the given point.
  // Treats the line as a line segment such that if the nearest point is an endpoint of the line,
  // the function will return 0 or 1 as appropriate.