35 #ifndef NAV_2D_UTILS_GEOMETRY_HELP_H 36 #define NAV_2D_UTILS_GEOMETRY_HELP_H 52 inline double distanceToLine(
double pX,
double pY,
double x0,
double y0,
double x1,
double y1)
59 double dot = A * C + B * D;
60 double len_sq = C * C + D * D;
61 double param = dot / len_sq;
81 return hypot(pX - xx, pY - yy);
85 #endif // NAV_2D_UTILS_GEOMETRY_HELP_H double distanceToLine(double pX, double pY, double x0, double y0, double x1, double y1)
Distance from point (pX, pY) to closest point on line from (x0, y0) to (x1, y1)
bool param(const std::string ¶m_name, T ¶m_val, const T &default_val)
A set of utility functions for Bounds objects interacting with other messages/types.
TFSIMD_FORCE_INLINE tfScalar dot(const Quaternion &q1, const Quaternion &q2)