diff --git a/vcg/space/line2.h b/vcg/space/line2.h index 2411c1d2..c756ef63 100644 --- a/vcg/space/line2.h +++ b/vcg/space/line2.h @@ -197,6 +197,16 @@ ScalarType Distance(const Line2 &l, return (o - p).Norm(); } +template +vcg::Point2 Mirror(const vcg::Line2 &l, + const vcg::Point2 &p) +{ + vcg::Point2 nearest=vcg::ClosestPoint(l,p); + vcg::Point2 dir=(nearest - p); + nearest+=dir; + return nearest; +} + /*@}*/ } // end namespace