distanceSquaredTo

Computes the estimated distance squared from the closest point on a bounding sphere to a point.

// Sort bounding spheres from back to front
spheres.sort(function(a, b) {
return BoundingSphere.distanceSquaredTo(b, camera.positionWC) - BoundingSphere.distanceSquaredTo(a, camera.positionWC);
});

Return

The distance squared from the bounding sphere to the point. Returns 0 if the point is inside the sphere.

Parameters

sphere

The sphere.

cartesian

The point

See also