diff --git a/include/VABase.h b/include/VABase.h index abdf6c50d4aff9013a36818ccd692482b2338705..79729ff1c982032cb301159a92ea3f5c4c2c843d 100644 --- a/include/VABase.h +++ b/include/VABase.h @@ -313,6 +313,20 @@ public: oOrient[ "w" ] = w; return oOrient; }; + + inline double Length() const + { + return std::sqrt( x * x + y * y + z * z + w * w ); + }; + + inline void Norm() + { + auto l = Length(); + x /= l; + y /= l; + z /= l; + w /= l; + }; }; //! Stream output operator for Quaternion