fromCornerPoints

fun fromCornerPoints(corner: Cartesian3? = definedExternally, oppositeCorner: Cartesian3? = definedExternally, result: BoundingSphere? = definedExternally): BoundingSphere(source)

Computes a bounding sphere from the corner points of an axis-aligned bounding box. The sphere tightly and fully encompasses the box.

// Create a bounding sphere around the unit cube
const sphere = BoundingSphere.fromCornerPoints(new Cartesian3(-0.5, -0.5, -0.5), new Cartesian3(0.5, 0.5, 0.5));

Return

The modified result parameter or a new BoundingSphere instance if none was provided.

Parameters

corner

The minimum height over the rectangle.

oppositeCorner

The maximum height over the rectangle.

result

The object onto which to store the result.

See also