diff --git a/libs/geometry/parametrized_segment.hpp b/libs/geometry/parametrized_segment.hpp index e71af2e28..5bb32d0f3 100644 --- a/libs/geometry/parametrized_segment.hpp +++ b/libs/geometry/parametrized_segment.hpp @@ -9,17 +9,20 @@ namespace m2 { -// This class holds a parametrization of the -// line segment between two points p0 and p1. -// The parametrization is of the form -// p(t) = p0 + t * dir. -// Other conditions: -// dir is the normalized (p1 - p0) vector. -// length(dir) = 1. -// p(0) = p0. -// p(T) = p1 with T = length(p1 - p0). -// -// The points with t in [0, T] are the points of the segment. +/** + * @brief This class holds a parametrization of the line segment between two points `p0` and `p1`. + * + * The parametrization is of the form + * `p(t) = p0 + t * dir`. + * + * Other conditions: + * * `dir` is the normalized `(p1 - p0)` vector. + * * `length(dir) = 1`. + * * `p(0) = p0`. + * * `p(T) = p1` with `T = length(p1 - p0)`. + * + * The points with `t` in `[0, T]` are the points of the segment. + */ template class ParametrizedSegment { @@ -36,7 +39,9 @@ public: m_d = m_d / m_length; } - // Returns the squared (euclidean) distance from the segment to |p|. + /** + * @brief Returns the squared (euclidean) distance from the segment to `p`. + */ double SquaredDistanceToPoint(Point const & p) const { m2::PointD const diff(p - m_p0); @@ -52,7 +57,9 @@ public: return math::Pow2(CrossProduct(diff, m_d)); } - // Returns the point of the segment that is closest to |p|. + /** + * @brief Returns the point of the segment that is closest to `p`. + */ m2::PointD ClosestPointTo(Point const & p) const { m2::PointD const diff(p - m_p0);