49 buf <<
'(' << q.
w() <<
',' << q.
v() <<
')';
68 return qa*
pow((
inv(qa)*sign*qb), t);
80 for (
label i=1; i<qs.size(); i++)
99 const scalar magV =
mag(q.
v());
106 const scalar expW =
exp(q.
w());
111 expW*
sin(magV)*q.
v()/magV
118 const scalar magQ =
mag(q);
119 const scalar magV =
mag(q.
v());
123 if (magV != 0 && magQ != 0)
126 powq *= power*
acos(q.
w()/magQ);
129 return pow(magQ, power)*
exp(powq);
135 const scalar magQ =
mag(q);
136 const scalar magV =
mag(q.
v());
140 if (magV != 0 && magQ != 0)
143 powq *= power*
acos(q.
w()/magQ);
146 return pow(magQ, power)*
exp(powq);
157 is >> q.
w() >> q.
v();
163 is.
check(
"operator>>(Istream&, quaternion&)");
Istream & readBegin(const char *funcName)
dimensionedScalar sign(const dimensionedScalar &ds)
dimensionedScalar acos(const dimensionedScalar &ds)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
virtual bool check(const char *operation) const
Check IOstream status for given operation.
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
scalar w() const
Scalar part of the quaternion ( = cos(theta/2) for rotation)
quaternion()
Construct null.
Vector< scalar > vector
A scalar version of the templated Vector.
static const char *const typeName
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
static const quaternion zero
Istream & readEnd(const char *funcName)
dimensionedScalar cos(const dimensionedScalar &ds)
dimensionedScalar exp(const dimensionedScalar &ds)
A class for handling words, derived from string.
Istream & operator>>(Istream &, directionInfo &)
const vector & v() const
Vector part of the quaternion ( = axis of rotation)
Quaternion class used to perform rotations in 3D space.
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &df)
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
An Ostream is an abstract base class for all output systems (streams, files, token lists...
dimensionedScalar sin(const dimensionedScalar &ds)
static const quaternion I
word name(const complex &)
Return a string representation of a complex.
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
quaternion slerp(const quaternion &qa, const quaternion &qb, const scalar t)
Spherical linear interpolation of quaternions.
Ostream & operator<<(Ostream &, const ensightPart &)
string str() const
Return the string.
dimensioned< scalar > mag(const dimensioned< Type > &)
Output to memory buffer stream.