diff --git a/include/ceres/rotation.h b/include/ceres/rotation.h index 397787d51..e3dbfe84a 100644 --- a/include/ceres/rotation.h +++ b/include/ceres/rotation.h @@ -417,7 +417,7 @@ void AngleAxisToRotationMatrix( R(1, 2) = -wx*sintheta + wy*wz*(kOne - costheta); R(2, 2) = costheta + wz*wz*(kOne - costheta); } else { - // At zero, we switch to using the first order Taylor expansion. + // Near zero, we switch to using the first order Taylor expansion. R(0, 0) = kOne; R(1, 0) = angle_axis[2]; R(2, 0) = -angle_axis[1]; @@ -625,7 +625,7 @@ void AngleAxisRotatePoint(const T angle_axis[3], const T pt[3], T result[3]) { // and actually performing multiplication with the point pt, gives us // R * pt = pt + w x pt. // - // Switching to the Taylor expansion at zero provides meaningful + // Switching to the Taylor expansion near zero provides meaningful // derivatives when evaluated using Jets. // // Explicitly inlined evaluation of the cross product for diff --git a/internal/ceres/rotation_test.cc b/internal/ceres/rotation_test.cc index cc4cc924e..42fdfee11 100644 --- a/internal/ceres/rotation_test.cc +++ b/internal/ceres/rotation_test.cc @@ -576,7 +576,7 @@ TEST(Rotation, AngleAxisToRotationMatrixAndBackNearZero) { RotationMatrixToAngleAxis(matrix, round_trip); for (int i = 0; i < 3; ++i) { - EXPECT_NEAR(round_trip[i], axis_angle[i], kTolerance); + EXPECT_NEAR(round_trip[i], axis_angle[i], std::numeric_limits::epsilon()); } } }