summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-03-21 20:09:34 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2024-03-21 20:09:34 +0000
commit31f73b6f44f3deac749af41e84435f5bc9b037f2 (patch)
treee9de1a70be1256f1ad6929d52631f3e3b68f42a6 /lib
parentvector_yaw only needs 2 dimensions (diff)
downloadilt-31f73b6f44f3deac749af41e84435f5bc9b037f2.tar.bz2
ilt-31f73b6f44f3deac749af41e84435f5bc9b037f2.tar.xz
ilt-31f73b6f44f3deac749af41e84435f5bc9b037f2.zip
Make arc_length a member function
Diffstat (limited to 'lib')
-rw-r--r--lib/maths.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/maths.h b/lib/maths.h
index ce18b3f..20a397b 100644
--- a/lib/maths.h
+++ b/lib/maths.h
@@ -19,6 +19,12 @@ struct Arc : public std::pair<float, float> {
{
return i ? second : first;
}
+
+ [[nodiscard]] constexpr inline float
+ length() const
+ {
+ return second - first;
+ }
};
constexpr const RelativePosition3D up {0, 0, 1};
@@ -171,12 +177,6 @@ operator%=(glm::vec<L, T, Q> & p, const glm::mat<L + 1, L + 1, T, Q> & mutation)
return p = p % mutation;
}
-constexpr inline float
-arc_length(const Arc & arc)
-{
- return arc.second - arc.first;
-}
-
float normalize(float ang);
template<typename T, glm::qualifier Q>