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

Function Azimuth

libs/geometry/angles.hpp:93–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91/// in range [0, 2 * pi]
92template <typename T>
93T Azimuth(m2::Point<T> const & p1, m2::Point<T> const & p2, T north = 0)
94{
95 T azimuth = math::pi2 - (AngleTo(p1, p2) + north);
96 if (azimuth < 0)
97 azimuth += 2.0 * math::pi;
98 return azimuth;
99}
100
101/// Average angle calcker. Can't find any suitable solution, so decided to do like this:
102/// Avg(i) = Avg(Avg(i-1), Ai);

Callers 2

UNIT_TESTFunction · 0.85
GetDistanceAndAzimutMethod · 0.85

Calls 1

AngleToFunction · 0.85

Tested by 1

UNIT_TESTFunction · 0.68