39#ifndef Foam_quaternion_H
40#define Foam_quaternion_H
73 inline static vector twoAxes
83 inline static vector threeAxes
130 static constexpr const char*
const typeName =
"quaternion";
164 const scalar cosTheta,
165 const bool isNormalised
244 inline
void operator=(const scalar
s);
247 inline
void operator=(const
vector&
v);
250 inline
void operator=(const
Foam::
zero);
252 inline
void operator*=(const scalar
s);
253 inline
void operator/=(const scalar
s);
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Quaternion class used to perform rotations in 3D space.
quaternion & normalise(const scalar tol=ROOTVSMALL)
Inplace normalise the quaternion by its magnitude.
quaternion(const quaternion &)=default
Copy construct.
vector eulerAngles(const eulerOrder order) const
Return the Euler rotation angles corresponding to the specified rotation order.
const vector & v() const noexcept
Vector part of the quaternion ( = axis of rotation).
tensor R() const
The rotation tensor corresponding to the quaternion.
static quaternion unit(const vector &v)
Return the unit quaternion (versor) from the given vector (w = sqrt(1 - |sqr(v)|)).
quaternion normalized() const
Return the quaternion normalised by its magnitude.
static constexpr direction rank
Rank of quaternion is 1.
scalar magType
Magnitude type.
scalar w() const noexcept
Scalar part of the quaternion ( = cos(theta/2) for rotation).
quaternion & operator=(const quaternion &)=default
Copy assignment.
vector transform(const vector &v) const
Rotate the given vector.
quaternion()=default
Default construct.
static constexpr const char *const typeName
static const Enum< eulerOrder > eulerOrderNames
The names for Euler-angle and Tait-Bryan angles, including "rollPitchYaw" and "yawPitchRoll" aliases.
scalar cmptType
Component type.
static const quaternion I
void normalize()
Inplace normalise the quaternion by its magnitude.
eulerOrder
Euler-angle rotation order.
static const quaternion zero
vector invTransform(const vector &v) const
Rotate the given vector anti-clockwise.
A class for handling words, derived from Foam::string.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
OBJstream os(runTime.globalPath()/outputName)
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
tmp< faMatrix< Type > > operator-(const faMatrix< Type > &)
Unary negation.
bool operator!=(const eddy &a, const eddy &b)
dimensionedScalar exp(const dimensionedScalar &ds)
quaternion normalised(const quaternion &q)
Return the normalised (unit) quaternion of the given quaternion.
tmp< faMatrix< Type > > operator+(const faMatrix< Type > &, const faMatrix< Type > &)
tensor rotationTensor(const vector &n1, const vector &n2)
Rotational transformation tensor from vector n1 to n2.
quaternion normalize(const quaternion &q)
Return the normalised (unit) quaternion of the given quaternion.
tmp< faMatrix< Type > > operator*(const areaScalarField::Internal &, const faMatrix< Type > &)
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces).
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
dimensionedScalar operator/(const scalar s1, const dimensionedScalar &ds2)
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
tmp< GeometricField< Type, faPatchField, areaMesh > > operator&(const faMatrix< Type > &, const DimensionedField< Type, areaMesh > &)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
Istream & operator>>(Istream &, directionInfo &)
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
quaternion conjugate(const quaternion &q)
Return the conjugate of the given quaternion.
quaternion slerp(const quaternion &qa, const quaternion &qb, const scalar t)
Spherical linear interpolation of quaternions.
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &f1, const label comm)
class FOAM_DEPRECATED_FOR(2017-05, "Foam::Enum") NamedEnum
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
Includes some common C++ headers, defines global macros and templates used in multiple places by Open...
#define FOAM_DEPRECATED_FOR(since, replacement)
A template class to specify if a data type is composed solely of Foam::scalar elements.
A template class to specify that a data type can be considered as being contiguous in memory.