Lines Matching refs:q1
24 template<typename QuatType> void check_slerp(const QuatType& q0, const QuatType& q1) in check_slerp() argument
32 Scalar theta_tot = AA(q1*q0.inverse()).angle(); in check_slerp()
37 QuatType q = q0.slerp(t,q1); in check_slerp()
71 Quaternionx q1, q2; in quaternion() local
74 q1.coeffs().setRandom(); in quaternion()
75 VERIFY_IS_APPROX(q1.coeffs(), (q1*q2).coeffs()); in quaternion()
78 q1 *= q2; in quaternion()
80 q1 = AngleAxisx(a, v0.normalized()); in quaternion()
84 Scalar refangle = abs(AngleAxisx(q1.inverse()*q2).angle()); in quaternion()
88 if((q1.coeffs()-q2.coeffs()).norm() > 10*largeEps) in quaternion()
90 VERIFY_IS_MUCH_SMALLER_THAN(abs(q1.angularDistance(q2) - refangle), Scalar(1)); in quaternion()
94 VERIFY_IS_APPROX(q1 * v2, q1.toRotationMatrix() * v2); in quaternion()
95 VERIFY_IS_APPROX(q1 * q2 * v2, in quaternion()
96 q1.toRotationMatrix() * q2.toRotationMatrix() * v2); in quaternion()
98 VERIFY( (q2*q1).isApprox(q1*q2, largeEps) in quaternion()
99 || !(q2 * q1 * v2).isApprox(q1.toRotationMatrix() * q2.toRotationMatrix() * v2)); in quaternion()
101 q2 = q1.toRotationMatrix(); in quaternion()
102 VERIFY_IS_APPROX(q1*v1,q2*v1); in quaternion()
106 AngleAxisx aa = AngleAxisx(q1); in quaternion()
107 VERIFY_IS_APPROX(q1 * v1, Quaternionx(aa) * v1); in quaternion()
115 VERIFY_IS_NOT_APPROX(q1 * v1, Quaternionx(AngleAxisx(aa.angle()*2,aa.axis())) * v1); in quaternion()
141 VERIFY_IS_APPROX(q1 * (q1.inverse() * v1), v1); in quaternion()
142 VERIFY_IS_APPROX(q1 * (q1.conjugate() * v1), v1); in quaternion()
145 Quaternion<float> q1f = q1.template cast<float>(); in quaternion()
146 VERIFY_IS_APPROX(q1f.template cast<Scalar>(),q1); in quaternion()
147 Quaternion<double> q1d = q1.template cast<double>(); in quaternion()
148 VERIFY_IS_APPROX(q1d.template cast<Scalar>(),q1); in quaternion()
154 q1 = AngleAxisx(a, v0.normalized()); in quaternion()
156 check_slerp(q1,q2); in quaternion()
158 q1 = AngleAxisx(b, v1.normalized()); in quaternion()
160 check_slerp(q1,q2); in quaternion()
162 q1 = AngleAxisx(b, v1.normalized()); in quaternion()
164 check_slerp(q1,q2); in quaternion()
166 q1.coeffs() = Vector4::Random().normalized(); in quaternion()
167 q2.coeffs() = -q1.coeffs(); in quaternion()
168 check_slerp(q1,q2); in quaternion()
200 Quaternionx q1 = mq1; in mapQuaternion() local
205 VERIFY_IS_APPROX(q1.coeffs(), q2.coeffs()); in mapQuaternion()
206 VERIFY_IS_APPROX(q1.coeffs(), q3.coeffs()); in mapQuaternion()
225 VERIFY_IS_APPROX(mq1*mq2, q1*q2); in mapQuaternion()
227 VERIFY_IS_APPROX(mcq1*mq2, q1*q2); in mapQuaternion()
240 QuaternionA *q1 = ::new(reinterpret_cast<void*>(array1)) QuaternionA; in quaternionAlignment() local
244 q1->coeffs().setRandom(); in quaternionAlignment()
245 *q2 = *q1; in quaternionAlignment()
246 *q3 = *q1; in quaternionAlignment()
248 VERIFY_IS_APPROX(q1->coeffs(), q2->coeffs()); in quaternionAlignment()
249 VERIFY_IS_APPROX(q1->coeffs(), q3->coeffs()); in quaternionAlignment()