mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
quaternion: Added new "normalized" function which returns the normalized form of the argument
This commit is contained in:
@ -140,6 +140,8 @@ public:
|
||||
//- The rotation tensor corresponding the quaternion
|
||||
inline tensor R() const;
|
||||
|
||||
inline quaternion normalized() const;
|
||||
|
||||
|
||||
// Edit
|
||||
|
||||
|
||||
@ -166,6 +166,12 @@ inline Foam::vector& Foam::quaternion::v()
|
||||
}
|
||||
|
||||
|
||||
inline Foam::quaternion Foam::quaternion::normalized() const
|
||||
{
|
||||
return *this/mag(*this);
|
||||
}
|
||||
|
||||
|
||||
inline void Foam::quaternion::normalize()
|
||||
{
|
||||
operator/=(mag(*this));
|
||||
|
||||
Reference in New Issue
Block a user