Skip to content
Snippets Groups Projects
Commit dda3459f authored by mattijs's avatar mattijs
Browse files

ENH: septernion: added slerp

parent b53fff01
Branches
Tags
No related merge requests found
......@@ -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)
......
......@@ -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<>
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment