code: public static boolean intersectPlaneSphere(
              double a, double b, double c, double d,
              double centerX, double centerY, double centerZ, double radius,
              Vector4d intersectionCenterAndRadius) {
          double invDenom = 1.0 / Math.sqrt(a * a + b * b + c * c);
          double dist = (a * centerX + b * centerY + c * centerZ + d) * invDenom;
          if (-radius <= dist && dist <= radius) {
              intersectionCenterAndRadius.x = centerX + dist * a * invDenom;
              intersectionCenterAndRadius.y = centerY + dist * b * invDenom;
              intersectionCenterAndRadius.z = centerZ + dist * c * invDenom;
              intersectionCenterAndRadius.w = Math.sqrt(radius * radius - dist * dist);
              return true;
          }
          return false;
      }
docs: Test whether the plane with the general plane equation <i>a*x + b*y + c*z + d = 0</i> intersects the sphere with center
  <code>(centerX, centerY, centerZ)</code> and <code>radius</code>, and store the center of the circle of
  intersection in the <code>(x, y, z)</code> components of the supplied vector and the radius of that circle in the w component.
  <p>
  Reference: <a href="http://math.stackexchange.com/questions/943383/determine-circle-of-intersection-of-plane-and-sphere">http://math.stackexchange.com</a>
  
  @param a
  the x factor in the plane equation
  @param b
  the y factor in the plane equation
  @param c
  the z factor in the plane equation
  @param d
  the constant in the plane equation
  @param centerX
  the x coordinate of the sphere's center
  @param centerY
  the y coordinate of the sphere's center
  @param centerZ
  the z coordinate of the sphere's center
  @param radius
  the radius of the sphere
  @param intersectionCenterAndRadius
  will hold the center of the circle of intersection in the <code>(x, y, z)</code> components and the radius in the w component
  @return <code>true</code> iff the plane intersects the sphere; <code>false</code> otherwise