mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-04-29 07:14:12 +08:00
Optimize slerp() as proposed by Gopinath Vasalamarri.
This commit is contained in:
parent
66d8111ac1
commit
d2dce37767
@ -793,7 +793,7 @@ EIGEN_DEVICE_FUNC Quaternion<typename internal::traits<Derived>::Scalar> Quatern
|
||||
} else {
|
||||
// theta is the angle between the 2 quaternions
|
||||
Scalar theta = acos(absD);
|
||||
Scalar sinTheta = sin(theta);
|
||||
Scalar sinTheta = numext::sqrt(Scalar(1) - absD * absD);
|
||||
|
||||
scale0 = sin((Scalar(1) - t) * theta) / sinTheta;
|
||||
scale1 = sin((t * theta)) / sinTheta;
|
||||
|
Loading…
x
Reference in New Issue
Block a user