Function Latitude.tryFromDegrees

Construct a latitude from degrees without throwing.

static bool tryFromDegrees(
  const T degrees,
  out Latitude result
) pure nothrow @nogc @safe;

Parameters

NameDescription
degrees Latitude in the closed interval [-90,+90] degrees.
result Receives the constructed latitude on success.

Returns

true on success; false for non-finite or out-of-domain input. On failure result is initialized to .init on entry and has no guaranteed value on failure.

Example

Example checking latitude degrees without throwing.

import geodesy;
Latitude!double latitude;
assert(Latitude!double.tryFromDegrees(48.20849, latitude));
assert(latitude.degrees > 48.0);