Function Longitude.tryFromDegrees
Construct a longitude from degrees without throwing.
Parameters
| Name | Description |
|---|---|
| degrees | Longitude in the closed interval [-180,+180] degrees. |
| 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 degrees without throwing.
import geodesy;
Longitude!double longitude;
assert(Longitude!double .tryFromDegrees(16.37208, longitude));
assert(longitude .degrees > 16.0);