fromPoints

fun fromPoints(positions: ReadonlyArray<Cartesian3>? = definedExternally, result: BoundingSphere? = definedExternally): BoundingSphere(source)

Computes a tight-fitting bounding sphere enclosing a list of 3D Cartesian points. The bounding sphere is computed by running two algorithms, a naive algorithm and Ritter's algorithm. The smaller of the two spheres is used to ensure a tight fit.

Return

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

Parameters

positions

An array of points that the bounding sphere will enclose. Each point must have x, y, and z properties.

result

The object onto which to store the result.

See also