STYLE: comments and parameter names for coordinateRotations::euler

This commit is contained in:
Mark Olesen
2019-05-03 13:31:00 +02:00
committed by Andrew Heather
parent 675aa8053a
commit 3089a11647
3 changed files with 43 additions and 29 deletions

View File

@ -47,14 +47,24 @@ using namespace Foam::coordinateRotations;
void printRotation(const tensor& rot)
{
Info<< "rotation = " << rot << nl;
Info<< "[\n"
<< " " << rot.xx() << ' ' << rot.xy() << ' ' << rot.xz() << nl
<< " " << rot.yx() << ' ' << rot.yy() << ' ' << rot.yz() << nl
<< " " << rot.zx() << ' ' << rot.zy() << ' ' << rot.zz() << nl
<< "]\n";
}
void printRotation(const quaternion& quat)
{
printRotation(quat.R());
Info<< "quaternion " << quat << nl;
tensor rot(quat.R());
Info<< "quaternion " << quat << nl
<< "rotation" << nl;
printRotation(rot);
Info<< "transpose" << nl;
printRotation(rot.T());
}
@ -139,6 +149,12 @@ int main(int argc, char *argv[])
<< " psi " << rotVector.z() << nl;
printRotation(euler(rotVector, true).R());
rotVector *= degToRad();
const quaternion quat(quaternion::rotationSequence::ZXZ, rotVector);
printRotation(quat);
}
if (args.readIfPresent("xyz", rotVector))
{