Function Latitude.tryFromRadians

Construct a latitude from radians without throwing.

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

Parameters

NameDescription
radians Latitude in the closed interval [-pi/2,+pi/2].
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 radians without throwing.

import geodesy;
Latitude!double latitude;
assert(Latitude!double.tryFromRadians(0.5, latitude));
assert(latitude.radians == 0.5);