private double findStopFraction()
  {
    // We would like to walk the full length of centerToAff ...
    double scale = 1;
    stopper = -1;

    // ... but one of the points in S might hinder us
    for (int j = 0; j < size; ++j)
      if (!support.isMember(j))
      {
        // Compute vector centerToPoint from center to the point S[j]:
        for (int i = 0; i < dim; ++i)
          centerToPoint[i] = S.coord(j, i) - center[i];

        double dirPointProd = 0;
        for (int i = 0; i < dim; ++i)
          dirPointProd += centerToAff[i] * centerToPoint[i];

        // We can ignore points beyond support since they stay enclosed anyway
        if (distToAffSquare - dirPointProd < Eps * radius * distToAff) continue;

        // Compute the fraction we can walk along centerToAff until
        // we hit point S[i] on the boundary.
        // (Better don't try to understand this calculus from the code,
        // it needs some pencil-and-paper work.)
        double bound = 0;
        for (int i = 0; i < dim; ++i)
          bound += centerToPoint[i] * centerToPoint[i];
        bound = (squaredRadius - bound) / 2 / (distToAffSquare - dirPointProd);

        // Take the smallest fraction
        if (bound > 0 && bound < scale)
        {
          if (log) debug("found stopper " + j + " bound=" + bound + " scale=" + scale);
          scale = bound;
          stopper = j;
        }
      }

    return scale;
  }