49 buf <<
'(' << q.
w() <<
',' << q.
v() <<
')';
68 return qa*
pow((
inv(qa)*sign*qb), t);
74 const scalar magV =
mag(q.
v());
81 const scalar expW =
exp(q.
w());
86 expW*
sin(magV)*q.
v()/magV
93 const scalar magQ =
mag(q);
94 const scalar magV =
mag(q.
v());
98 if (magV != 0 && magQ != 0)
101 powq *= power*
acos(q.
w()/magQ);
104 return pow(magQ, power)*
exp(powq);
110 const scalar magQ =
mag(q);
111 const scalar magV =
mag(q.
v());
115 if (magV != 0 && magQ != 0)
118 powq *= power*
acos(q.
w()/magQ);
121 return pow(magQ, power)*
exp(powq);
132 is >> q.
w() >> q.
v();
138 is.
check(
"operator>>(Istream&, quaternion&)");
static const char *const typeName
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
static const quaternion zero
dimensioned< scalar > mag(const dimensioned< Type > &)
word name(const complex &)
Return a string representation of a complex.
const vector & v() const
Vector part of the quaternion ( = axis of rotation)
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Quaternion class used to perform rotations in 3D space.
string str() const
Return the string.
A class for handling words, derived from string.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
dimensionedScalar exp(const dimensionedScalar &ds)
dimensionedScalar sign(const dimensionedScalar &ds)
Ostream & operator<<(Ostream &, const edgeMesh &)
virtual bool check(const char *operation) const
Check IOstream status for given operation.
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
scalar w() const
Scalar part of the quaternion ( = cos(theta/2) for rotation)
quaternion()
Construct null.
dimensionedScalar cos(const dimensionedScalar &ds)
Output to memory buffer stream.
dimensionedScalar acos(const dimensionedScalar &ds)
Istream & readBegin(const char *funcName)
Istream & operator>>(Istream &, edgeMesh &)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Vector< scalar > vector
A scalar version of the templated Vector.
quaternion slerp(const quaternion &qa, const quaternion &qb, const scalar t)
Spherical linear interpolation of quaternions.
static const quaternion I
Istream & readEnd(const char *funcName)
dimensionedScalar sin(const dimensionedScalar &ds)