diff --git a/geom/segment.hpp b/geom/segment.hpp index 2122376b..0ba99023 100644 --- a/geom/segment.hpp +++ b/geom/segment.hpp @@ -44,6 +44,18 @@ namespace cruft::geom { }; + /// Offset a segment by the supplied vector. + template + segment + operator+ (segment lhs, vector rhs) + { + return { + lhs.a + rhs, + lhs.b + rhs + }; + } + + /// Return the squared distance from the closest point of the segment `s` /// to the point `p`. template