public void averagePoints(Vector3f[] points) {
        logger.fine("Bounding Sphere calculated using average points.");
        center = points[0];

        for (int i = 1; i < points.length; i++) {
            center.addLocal(points[i]);
        }

        float quantity = 1.0f / points.length;
        center.multLocal(quantity);

        float maxRadiusSqr = 0;
        for (int i = 0; i < points.length; i++) {
            Vector3f diff = points[i].subtract(center);
            float radiusSqr = diff.lengthSquared();
            if (radiusSqr > maxRadiusSqr) {
                maxRadiusSqr = radiusSqr;
            }
        }

        radius = (float) Math.sqrt(maxRadiusSqr) + RADIUS_EPSILON - 1f;

    }
<code>averagePoints</code> selects the sphere center to be the average
of the points and the sphere radius to be the smallest value to enclose
all points.

@param points
           the list of points to contain.
jme3-core/src/main/java/com/jme3/bounding/BoundingSphere.java