Skip to main content

pack_sphere_radius

Function pack_sphere_radius 

Source
pub fn pack_sphere_radius(center: Vector3D, radius: f64) -> Result<f32, String>
Expand description

Returns the packed radius of a sphere whose centre is packed toward negative infinity.

The packed centre is never above the source, so it can sit up to half an ulp below it on each axis. The radius absorbs the worst-case corner displacement of that drift, sqrt(3) half-ulp, and is then rounded up so the packed sphere still contains every point of the source sphere.

§Arguments

  • Vector3D - The sphere centre, sampled for its ulp scale.
  • f64 - The source radius.

§Returns

  • Result<f32, String> - The widened radius, rounded up.