From 168112cf843abe884e6b35119e21590100ec3c78 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Wed, 28 Mar 2018 15:49:02 +0200 Subject: [PATCH] SEG: added Center() method --- include/geometry/seg.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/geometry/seg.h b/include/geometry/seg.h index 85f146a1bb..792b00c663 100644 --- a/include/geometry/seg.h +++ b/include/geometry/seg.h @@ -321,6 +321,12 @@ public: std::swap( A, B ); } + ///> Returns the center point of the line + VECTOR2I Center() const + { + return A + ( B - A ) / 2; + } + private: bool ccw( const VECTOR2I& aA, const VECTOR2I& aB, const VECTOR2I &aC ) const;