             }
         }
         if (ritterRadius < naiveRadius) {
-            result.center = ritterCenter
-            result.radius = ritterRadius
+            center = ritterCenter
+            radius = ritterRadius
         } else {
-            result.center = naiveCenter
-            result.radius = naiveRadius
-        }
-        return result
+            center = naiveCenter
+            radius = naiveRadius
+        }
     }
    
     /**

            let height = upperRight.y - lowerLeft.y
            let elevation = upperRight.z - lowerLeft.z
            
            return BoundingSphere(
                center: Cartesian3(x: lowerLeft.x + width * 0.5, y: lowerLeft.y + height * 0.5, z: lowerLeft.z + elevation * 0.5),
                radius: sqrt(width * width + height * height + elevation * elevation) * 0.5)
    }

/**
* Computes a bounding sphere from an rectangle in 3D. The bounding sphere is created using a subsample of points
* on the ellipsoid and contained in the rectangle. It may not be accurate for all rectangles on all types of ellipsoids.
*
* @param {Rectangle} rectangle The valid rectangle used to create a bounding sphere.
* @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid used to determine positions of the rectangle.
* @param {Number} [surfaceHeight=0.0] The height above the surface of the ellipsoid.
* @param {BoundingSphere} [result] The object onto which to store the result.
* @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.
*/
    /*
BoundingSphere.fromRectangle3D = function(rectangle, ellipsoid, surfaceHeight, result) {
    ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);
    surfaceHeight = defaultValue(surfaceHeight, 0.0);
    
    var positions;
    if (defined(rectangle)) {
        positions = Rectangle.subsample(rectangle, ellipsoid, surfaceHeight, fromRectangle3DScratch);
    }
    
    return BoundingSphere.fromPoints(positions, result);
};
*/
    /**
    * Computes a tight-fitting bounding sphere enclosing a list of 3D points, where the points are
    * stored in a flat array in X, Y, Z, order.  The bounding sphere is computed by running two

    * @param {BoundingSphere} [result] The object onto which to store the result.
    * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.
    */
    init (fromRectangle2D rectangle: Rectangle?, projection: MapProjection = GeographicProjection()) {
        self.init(fromRectangleWithHeights2D: rectangle, projection: projection, minimumHeight: 0.0, maximumHeight: 0.0)
    }

    /**
