code: func (s *Server) newCheckServiceNodeSorter(cs lib.CoordinateSet, nodes structs.CheckServiceNodes) (sort.Interface, error) {
  	state := s.fsm.State()
  	vec := make([]float64, len(nodes))
  	for i, node := range nodes {
  		_, other, err := state.Coordinate(node.Node.Node, nil)
  		if err != nil {
  			return nil, err
  		}
  		c1, c2 := cs.Intersect(other)
  		vec[i] = lib.ComputeDistance(c1, c2)
  	}
  	return &checkServiceNodeSorter{nodes, vec}, nil
  }
docs: // newCheckServiceNodeSorter returns a new sorter for the given source coordinate
  // and set of nodes with health checks.