code: func (p *Path) Resample(totalPoints int) *Path {
  	if totalPoints <= 0 {
  		p.PointSet = make([]Point, 0)
  		return p
  	}
  
  	if p.resampleEdgeCases(totalPoints) {
  		return p
  	}
  
  	// precomputes the total distance and intermediate distances
  	total, dists := precomputeDistances(p.PointSet)
  	p.resample(dists, total, totalPoints)
  	return p
  }
docs: // Resample converts the path into totalPoints-1 evenly spaced segments.
  // Assumes euclidean geometry.