Function Angle.tryFromRadians

Construct from radians without throwing.

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

Parameters

NameDescription
radians Finite angle in radians.
result Receives the constructed angle on success.

Returns

true on success; false for NaN or infinity. On failure result is initialized to .init on entry and has no guaranteed value on failure.

Example

Example checking radian input without throwing.

import geodesy;
Angle!double angle;
assert(Angle!double.tryFromRadians(0.5, angle));
assert(angle.radians == 0.5);