db7fac3f24
git-svn-id: https://openfoam-extend.svn.sourceforge.net/svnroot/openfoam-extend/trunk/Core/OpenFOAM-1.5-dev@1731 e4e07f05-0c2f-0410-a05a-b8ba57e0c909
37 lines
940 B
C
37 lines
940 B
C
#include "quaternion.H"
|
|
#include "septernion.H"
|
|
#include "IOstreams.H"
|
|
|
|
using namespace Foam;
|
|
|
|
int main()
|
|
{
|
|
quaternion q(vector(1, 0, 0), 0.7853981);
|
|
Info<< "q " << q << endl;
|
|
|
|
vector v(0, 1, 0);
|
|
Info<< "v " << v << endl;
|
|
|
|
Info<< "inv(q)*q " << inv(q)*q << endl;
|
|
|
|
Info<< "q*quaternion(0, v)*conjugate(q) "
|
|
<< q*quaternion(0, v)*conjugate(q) << endl;
|
|
|
|
Info<< "q.transform(v) " << q.transform(v) << endl;
|
|
Info<< "q.R() & v " << (q.R() & v) << endl;
|
|
|
|
Info<< "q.invTransform(v) " << q.invTransform(v) << endl;
|
|
|
|
septernion tr(vector(0, 0.1, 0), q);
|
|
Info<< "tr " << tr << endl;
|
|
|
|
Info<< "inv(tr)*tr " << inv(tr)*tr << endl;
|
|
|
|
Info<< "tr.transform(v) " << tr.transform(v) << endl;
|
|
|
|
Info<< "(septernion(vector(0, -1, 0))*q*septernion(vector(0, 1, 0))).transform(v) "
|
|
<< (septernion(vector(0, -1, 0))*q*septernion(vector(0, 1, 0))).transform(v)
|
|
<< endl;
|
|
|
|
return 0;
|
|
}
|