Function Ellipsoid.sphere
Construct a sphere or throw when the radius is invalid.
Parameters
| Name | Description |
|---|---|
| radius | Finite positive radius in the caller-selected linear unit. |
Returns
The constructed sphere with zero flattening.
Throws
GeodesyValueException for a non-positive or non-finite radius.
Example
Example constructing a spherical Earth model.
import geodesy;
const sphere = Ellipsoid!double .sphere(6_371_000.0);
assert(sphere .semiMajorAxis == sphere .semiMinorAxis);