code: func unitVectorAt(vec1 []float64, vec2 []float64) ([]float64, float64) {
  	ret := diff(vec1, vec2)
  
  	// If the coordinates aren't on top of each other we can normalize.
  	if mag := magnitude(ret); mag > zeroThreshold {
  		return mul(ret, 1.0/mag), mag
  	}
  
  	// Otherwise, just return a random unit vector.
  	for i := range ret {
  		ret[i] = rand.Float64() - 0.5
  	}
  	if mag := magnitude(ret); mag > zeroThreshold {
  		return mul(ret, 1.0/mag), 0.0
  	}
  
  	// And finally just give up and make a unit vector along the first
  	// dimension. This should be exceedingly rare.
  	ret = make([]float64, len(ret))
  	ret[0] = 1.0
  	return ret, 0.0
  }
docs: // unitVectorAt returns a unit vector pointing at vec1 from vec2. If the two
  // positions are the same then a random unit vector is returned. We also return
  // the distance between the points for use in the later height calculation.