func CloseCenter(p gopark.Vector, centers []gopark.Vector) int { minDist := p.EulaDistance(centers[0]) minIndex := 0 for i := 1; i < len(centers); i++ { dist := p.EulaDistance(centers[i]) if dist < minDist { minDist = dist minIndex = i } } return minIndex }