code: func (p *Path) Measure(point *Point) float64 {
  	minDistance := math.Inf(1)
  	measure := math.Inf(-1)
  	sum := 0.0
  
  	seg := &Line{}
  	for i := 0; i < len(p.PointSet)-1; i++ {
  		seg.a = p.PointSet[i]
  		seg.b = p.PointSet[i+1]
  		distanceToLine := seg.SquaredDistanceFrom(point)
  		if distanceToLine < minDistance {
  			minDistance = distanceToLine
  			measure = sum + seg.Measure(point)
  		}
  		sum += seg.Distance()
  	}
  	return measure
  }
docs: // Measure computes the distance along this path to the point nearest the given point.