Function Ellipsoid.trySphere
Construct a sphere without throwing; radius must be finite and positive.
Parameters
| Name | Description |
|---|---|
| radius | Finite positive radius in the caller-selected linear unit. |
| result | Receives the constructed sphere on success. |
Returns
true on success; false for a non-positive or non-finite radius.
On failure result is initialized to on entry and has no guaranteed value on failure.
Example
Example checking spherical construction without throwing.
import geodesy;
Ellipsoid!double sphere;
assert(Ellipsoid!double .trySphere(6_371_000.0, sphere));
assert(sphere .flattening == 0.0);