mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: septernion: added slerp
This commit is contained in:
@ -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<>
|
||||
|
||||
Reference in New Issue
Block a user