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

Method GetPolySegAngle

libs/routing/route.cpp:380–399  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

378}
379
380double Route::GetPolySegAngle(size_t ind) const
381{
382 size_t const polySz = m_poly.GetPolyline().GetSize();
383
384 if (ind + 1 >= polySz)
385 {
386 ASSERT(false, ());
387 return 0;
388 }
389
390 m2::PointD const p1 = m_poly.GetPolyline().GetPoint(ind);
391 m2::PointD p2;
392 size_t i = ind + 1;
393 do
394 {
395 p2 = m_poly.GetPolyline().GetPoint(i);
396 }
397 while (AlmostEqualULPs(p1, p2) && ++i < polySz);
398 return (i == polySz) ? 0 : math::RadToDeg(ang::AngleTo(p1, p2));
399}
400
401bool Route::MatchLocationToRoute(location::GpsInfo & location, location::RouteMatchingInfo & routeMatchingInfo) const
402{

Callers

nothing calls this directly

Calls 6

ASSERTFunction · 0.85
RadToDegFunction · 0.85
AngleToFunction · 0.85
AlmostEqualULPsFunction · 0.50
GetSizeMethod · 0.45
GetPointMethod · 0.45

Tested by

no test coverage detected