MCPcopy Create free account
hub / github.com/comaps/comaps / NormalizeAngle

Function NormalizeAngle

libs/platform/utm_mgrs_utils.cpp:54–62  ·  view source on GitHub ↗

Returns angle in radians to be between -π and π.

Source from the content-addressed store, hash-verified

52
53// Returns angle in radians to be between -π and π.
54double NormalizeAngle(double value)
55{
56 using math::pi;
57 if (value < -pi)
58 value += -2 * pi * (static_cast<int>(value - pi) / (2 * pi));
59 else if (value > pi)
60 value -= 2 * pi * (static_cast<int>(value + pi) / (2 * pi));
61 return value;
62}
63
64int LatLonToZoneNumber(double lat, double lon)
65{

Callers 2

LatLonToUtmFunction · 0.70
UTMtoLatLonFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected