code: func precomputeDistances(p PointSet) (float64, []float64) {
  	total := 0.0
  	dists := make([]float64, len(p)-1)
  	for i := 0; i < len(p)-1; i++ {
  		dists[i] = p[i].DistanceFrom(&p[i+1])
  		total += dists[i]
  	}
  
  	return total, dists
  }
docs: // precomputeDistances precomputes the total distance and intermediate distances.