Adding length() and norm() function of VAQuat

parent eb48c037
...@@ -313,6 +313,20 @@ public: ...@@ -313,6 +313,20 @@ public:
oOrient[ "w" ] = w; oOrient[ "w" ] = w;
return oOrient; 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 //! Stream output operator for Quaternion
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment