diff options
author | Tavian Barnes <tavianator@gmail.com> | 2009-09-11 18:01:56 +0000 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2009-09-11 18:01:56 +0000 |
commit | f8bd4dda645fda617bf37e180d35e4ef82c88e40 (patch) | |
tree | 16641a3d34947e26bba43345ef798382c88ee040 /libdimensionxx/dimensionxx/geometry.hpp | |
parent | e2c5e2760d98144ac65c4c9f15e7675ec7852319 (diff) | |
download | dimension-f8bd4dda645fda617bf37e180d35e4ef82c88e40.tar.xz |
Add dmnsn_vector_norm() and _normalize() wrappers.
Diffstat (limited to 'libdimensionxx/dimensionxx/geometry.hpp')
-rw-r--r-- | libdimensionxx/dimensionxx/geometry.hpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libdimensionxx/dimensionxx/geometry.hpp b/libdimensionxx/dimensionxx/geometry.hpp index 671e204..10cf452 100644 --- a/libdimensionxx/dimensionxx/geometry.hpp +++ b/libdimensionxx/dimensionxx/geometry.hpp @@ -283,6 +283,18 @@ namespace Dimension return r; } + inline double + norm(const Vector& v) + { + return dmnsn_vector_norm(v.dmnsn()); + } + + inline Vector + normalize(const Vector& v) + { + return Vector(dmnsn_vector_normalize(v.dmnsn())); + } + // Dot product inline double dot(const Vector& lhs, const Vector& rhs) |