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

Function ClampPoint

libs/coding/geometry_coding.cpp:16–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14namespace
15{
16inline m2::PointU ClampPoint(m2::PointD const & maxPoint, m2::PointD const & point)
17{
18 using uvalue_t = m2::PointU::value_type;
19 return {static_cast<uvalue_t>(math::Clamp(point.x, 0.0, maxPoint.x)),
20 static_cast<uvalue_t>(math::Clamp(point.y, 0.0, maxPoint.y))};
21}
22
23struct edge_less_p0
24{

Callers 2

PredictPointInPolylineFunction · 0.70
PredictPointInTriangleFunction · 0.70

Calls 1

ClampFunction · 0.85

Tested by

no test coverage detected