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

Function Bearing

tools/openlr/router.cpp:40–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38double const kAnglesInBucket = 360.0 / kNumBuckets;
39
40uint32_t Bearing(m2::PointD const & a, m2::PointD const & b)
41{
42 auto const angle = location::AngleToBearing(math::RadToDeg(ang::AngleTo(a, b)));
43 CHECK_LESS_OR_EQUAL(angle, 360, ("Angle should be less than or equal to 360."));
44 CHECK_GREATER_OR_EQUAL(angle, 0, ("Angle should be greater than or equal to 0"));
45 return math::Clamp(angle / kAnglesInBucket, 0.0, 255.0);
46}
47} // namespace
48
49// Router::Vertex::Score ---------------------------------------------------------------------------

Callers 2

FindPathMethod · 0.70
GetReverseBearingMethod · 0.70

Calls 4

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

Tested by

no test coverage detected