ENH: septernion: added slerp

This commit is contained in:
mattijs
2013-12-03 11:09:47 +00:00
parent b53fff01d7
commit dda3459f0d
2 changed files with 19 additions and 1 deletions

View File

@ -59,6 +59,17 @@ Foam::word Foam::name(const septernion& s)
}
Foam::septernion Foam::slerp
(
const septernion& qa,
const septernion& qb,
const scalar t
)
{
return septernion((1.0-t)*qa.t()+t*qb.t(), slerp(qa.r(), qb.r(), t));
}
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
Foam::Istream& Foam::operator>>(Istream& is, septernion& s)

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -157,6 +157,13 @@ inline septernion inv(const septernion& tr);
//- Return a string representation of a septernion
word name(const septernion&);
//- Spherical linear interpolation of septernions. 0 for qa, 1 for qb
septernion slerp
(
const septernion& qa,
const septernion& qb,
const scalar t
);
//- Data associated with septernion type are contiguous
template<>