From 9c2fce90b58b65b6c52802657fe5aff602d4afb2 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 18 Dec 2022 14:04:23 +0000 Subject: Helper for midpoint of pair --- lib/maths.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/maths.h b/lib/maths.h index 1c07baa..5bb69d3 100644 --- a/lib/maths.h +++ b/lib/maths.h @@ -3,6 +3,7 @@ #include #include #include +#include #include struct Arc : public std::pair { @@ -130,6 +131,13 @@ std::pair find_arc_centre(glm::vec2 start, glm::vec2 ad, glm::v std::pair find_arcs_radius(glm::vec2 start, float entrys, glm::vec2 end, float entrye); float find_arcs_radius(glm::vec2 start, glm::vec2 ad, glm::vec2 end, glm::vec2 bd); +template +auto +midpoint(const std::pair & v) +{ + return std::midpoint(v.first, v.second); +} + // Conversions template inline constexpr auto -- cgit v1.2.3