Template Function lanelet::geometry::signedDistance(const LineString2dT&, const BasicPoint2d&)

Function Documentation

template<typename LineString2dT>
double lanelet::geometry::signedDistance(const LineString2dT &lineString, const BasicPoint2d &p)

Calculate the metric signed distance from p to the LineString. The sign is positive if the point is left of the linestring when projecting to the xy-plane.

Todo:

not sure if this works as expected

If the point is before or behind the linestring, this is checked by extrapolating the first or last segment.

Parameters:
  • lineString – the linestring to check for

  • p – point to check for

Returns:

the metric signed distance in 2d.