From 8b4d278d3d3e2cffd0fb04601b3d38b17083e7e5 Mon Sep 17 00:00:00 2001 From: Oliver Sander <sander@igpm.rwth-aachen.de> Date: Fri, 5 Jan 2007 11:08:29 +0000 Subject: [PATCH] bugfix in interpolateDerivate and a unit test for the same method [[Imported from SVN: r1118]] --- src/quaternion.hh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/quaternion.hh b/src/quaternion.hh index 00fb41d0..ddd55033 100644 --- a/src/quaternion.hh +++ b/src/quaternion.hh @@ -235,6 +235,21 @@ public: result[0] = result[1] = result[2] = result[3] = 0; diffExp.umv(der,result); + + result = a.mult(result); + + double eps = 1e-6; + Quaternion<T> fdResult = interpolate(a,b, omega+eps); + fdResult -= interpolate(a,b, omega-eps); + fdResult /= 2*eps; + fdResult /= intervallLength; + + if ((result-fdResult).two_norm() > 1e-4) { + std::cout << "Wrong interpolation:\n"; + std::cout << "Analytical: " << result << " fd: " << fdResult << std::endl; + abort(); + } + #endif //std::cout << result << std::endl; return result; -- GitLab