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

Method PredictLocation

libs/map/framework.cpp:2334–2344  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2332}
2333
2334void Framework::PredictLocation(double & lat, double & lon, double accuracy, double bearing, double speed,
2335 double elapsedSeconds)
2336{
2337 double offsetInM = speed * elapsedSeconds;
2338 double angle = math::DegToRad(90.0 - bearing);
2339
2340 m2::PointD mercatorPt = mercator::MetersToXY(lon, lat, accuracy).Center();
2341 mercatorPt = mercator::GetSmPoint(mercatorPt, offsetInM * cos(angle), offsetInM * sin(angle));
2342 lon = mercator::XToLon(mercatorPt.x);
2343 lat = mercator::YToLat(mercatorPt.y);
2344}
2345
2346StringsBundle const & Framework::GetStringsBundle()
2347{

Callers

nothing calls this directly

Calls 6

DegToRadFunction · 0.85
MetersToXYFunction · 0.85
GetSmPointFunction · 0.85
XToLonFunction · 0.85
YToLatFunction · 0.85
CenterMethod · 0.45

Tested by

no test coverage detected