Function Longitude.tryFromRadians
Construct a longitude from radians without throwing.
Parameters
| Name | Description |
|---|---|
| radians | Longitude in the closed interval [-pi,+pi]. |
| result | Receives the constructed longitude on success. |
Returns
true on success; false for non-finite or out-of-domain input.
Both antimeridian endpoints are accepted. On failure result
is initialized to on entry and has no guaranteed value on failure.
Example
Example checking longitude radians without throwing.
import geodesy;
Longitude!double longitude;
assert(Longitude!double .tryFromRadians(0.25, longitude));
assert(longitude .radians == 0.25);