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

Function Bearing

tools/openlr/candidate_paths_getter.cpp:31–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29double const kAnglesInBucket = 360.0 / kNumBuckets;
30
31uint32_t Bearing(m2::PointD const & a, m2::PointD const & b)
32{
33 auto const angle = location::AngleToBearing(math::RadToDeg(ang::AngleTo(a, b)));
34 CHECK_LESS_OR_EQUAL(angle, 360, ("Angle should be less than or equal to 360."));
35 CHECK_GREATER_OR_EQUAL(angle, 0, ("Angle should be greater than or equal to 0"));
36 return math::Clamp(angle / kAnglesInBucket, 0.0, 255.0);
37}
38} // namespace cpg
39
40// CandidatePathsGetter::Link ----------------------------------------------------------------------

Callers 1

GetBestCandidatePathsMethod · 0.70

Calls 4

AngleToBearingFunction · 0.85
RadToDegFunction · 0.85
AngleToFunction · 0.85
ClampFunction · 0.85

Tested by

no test coverage detected