function squaredDistanceAxes(dimensions, axes, pivot, b) {
  var d;

  var dist = 0,
      step;

  for (d = 0; d < dimensions; d++) {
    step = axes[d][pivot] - b[d];
    dist += step * step;
  }

  return dist;
}
Helper function used to compute the squared distance between a query point
and an indexed points whose values are stored in a tree's axes.

Note that squared distance is used instead of euclidean to avoid
costly sqrt computations.

@param  {number} dimensions - Number of dimensions.
@param  {array}  axes       - Axes data.
@param  {number} pivot      - Pivot.
@param  {array}  point      - Query point.
@return {number}