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

Function GetPointAtDistFromTarget

generator/mini_roundabout_transformer.cpp:290–298  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

288}
289
290m2::PointD GetPointAtDistFromTarget(m2::PointD const & source, m2::PointD const & target, double dist)
291{
292 double const len = DistanceOnPlain(source, target);
293 if (len < dist)
294 return source;
295
296 double const k = (len - dist) / dist;
297 return (source + target * k) / (1.0 + k);
298}
299
300std::vector<m2::PointD> PointToPolygon(m2::PointD const & center, double radiusMercator, size_t verticesCount,
301 double initAngleDeg)

Callers 3

CreateSurrogateRoadMethod · 0.85
AddRoundaboutToRoadMethod · 0.85
UNIT_TESTFunction · 0.85

Calls 1

DistanceOnPlainFunction · 0.85

Tested by 1

UNIT_TESTFunction · 0.68