Blender V5.3
BLI_math_quaternion.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
10
14
15#include "BLI_math_matrix.hh"
16
17namespace blender {
18
19namespace math {
20
21/* -------------------------------------------------------------------- */
24
30template<typename T>
31[[nodiscard]] inline T dot(const QuaternionBase<T> &a, const QuaternionBase<T> &b);
32
38template<typename T> [[nodiscard]] QuaternionBase<T> pow(const QuaternionBase<T> &q, const T &y);
39
45template<typename T> [[nodiscard]] inline QuaternionBase<T> conjugate(const QuaternionBase<T> &a);
46
50template<typename T>
51[[nodiscard]] inline QuaternionBase<T> canonicalize(const QuaternionBase<T> &q);
52
58template<typename T> [[nodiscard]] inline QuaternionBase<T> invert(const QuaternionBase<T> &q);
59
65template<typename T>
66[[nodiscard]] inline QuaternionBase<T> invert_normalized(const QuaternionBase<T> &q);
67
72template<typename T> [[nodiscard]] inline QuaternionBase<T> normalize(const QuaternionBase<T> &q);
73template<typename T>
75 T &out_length);
76
81template<typename T>
82[[nodiscard]] inline QuaternionBase<T> interpolate(const QuaternionBase<T> &a,
83 const QuaternionBase<T> &b,
84 T t);
85
87
88/* -------------------------------------------------------------------- */
91
95template<typename T>
96[[nodiscard]] inline VecBase<T, 3> transform_point(const QuaternionBase<T> &q,
97 const VecBase<T, 3> &v);
98
100
101/* -------------------------------------------------------------------- */
104
108template<typename T> [[nodiscard]] inline bool is_zero(const QuaternionBase<T> &q)
109{
110 return q.w == T(0) && q.x == T(0) && q.y == T(0) && q.z == T(0);
111}
112
116template<typename T>
117[[nodiscard]] inline bool is_equal(const QuaternionBase<T> &a,
118 const QuaternionBase<T> &b,
119 const T epsilon = T(0))
120{
121 return math::abs(a.w - b.w) <= epsilon && math::abs(a.y - b.y) <= epsilon &&
122 math::abs(a.x - b.x) <= epsilon && math::abs(a.z - b.z) <= epsilon;
123}
124
125template<typename T> [[nodiscard]] inline bool is_unit_scale(const QuaternionBase<T> &q)
126{
127 /* Checks are flipped so NAN doesn't assert because we're making sure the value was
128 * normalized and in the case we don't want NAN to be raising asserts since there
129 * is nothing to be done in that case. */
130 const T test_unit = q.x * q.x + q.y * q.y + q.z * q.z + q.w * q.w;
131 return (!(math::abs(test_unit - T(1)) >= AssertUnitEpsilon<QuaternionBase<T>>::value) ||
132 !(math::abs(test_unit) >= AssertUnitEpsilon<QuaternionBase<T>>::value));
133}
134
136
137/* -------------------------------------------------------------------- */
140
141/* -------------- Conversions -------------- */
142
143template<typename T> AngleRadianBase<T> QuaternionBase<T>::twist_angle(const Axis axis) const
144{
145 /* The calculation requires a canonical quaternion. */
146 const VecBase<T, 4> input_vec(canonicalize(*this));
147
148 return T(2) * AngleRadianBase<T>(input_vec[0], input_vec.yzw()[axis.as_int()]);
149}
150
151template<typename T> QuaternionBase<T> QuaternionBase<T>::swing(const Axis axis) const
152{
153 /* The calculation requires a canonical quaternion. */
154 const QuaternionBase<T> input = canonicalize(*this);
155 /* Compute swing by multiplying the original quaternion by inverted twist. */
156 QuaternionBase<T> swing = input * invert_normalized(input.twist(axis));
157
159 0.0002f /*BLI_ASSERT_UNIT_EPSILON*/);
160 return swing;
161}
162
163template<typename T> QuaternionBase<T> QuaternionBase<T>::twist(const Axis axis) const
164{
165 /* The calculation requires a canonical quaternion. */
166 const VecBase<T, 4> input_vec(canonicalize(*this));
167
169 input_vec[0], input_vec.yzw()[axis.as_int()]);
170
171 VecBase<T, 4> twist(half_angle.cos(), T(0), T(0), T(0));
172 twist[axis.as_int() + 1] = half_angle.sin();
173 return QuaternionBase<T>(twist);
174}
175
176/* -------------- Methods -------------- */
177
178template<typename T>
180{
182 const QuaternionBase<T> &input = *this;
183 T len;
184 QuaternionBase<T> reference_normalized = normalize_and_get_length(reference, len);
185 /* Skips degenerate case. */
186 if (len < 1e-4f) {
187 return input;
188 }
189 QuaternionBase<T> result = reference * invert_normalized(reference_normalized) * input;
190 return (distance_squared(VecBase<T, 4>(-result), VecBase<T, 4>(reference)) <
192 -result :
193 result;
194}
195
196/* -------------- Functions -------------- */
197
198template<typename T>
199[[nodiscard]] inline T dot(const QuaternionBase<T> &a, const QuaternionBase<T> &b)
200{
201 return a.w * b.w + a.x * b.x + a.y * b.y + a.z * b.z;
202}
203
204template<typename T> [[nodiscard]] QuaternionBase<T> pow(const QuaternionBase<T> &q, const T &y)
205{
207 /* Reference material:
208 * https://en.wikipedia.org/wiki/Quaternion
209 *
210 * The power of a quaternion raised to an arbitrary (real) exponent y is given by:
211 * `q^x = ||q||^y * (cos(y * angle * 0.5) + n * sin(y * angle * 0.5))`
212 * where `n` is the unit vector from the imaginary part of the quaternion and
213 * where `angle` is the angle of the rotation given by `angle = 2 * acos(q.w)`.
214 *
215 * q being a unit quaternion, ||q||^y becomes 1 and is canceled out.
216 *
217 * `y * angle * 0.5` expands to `y * 2 * acos(q.w) * 0.5` which simplifies to `y * acos(q.w)`.
218 */
219 const T half_angle = y * math::safe_acos(q.w);
220 return {math::cos(half_angle), math::sin(half_angle) * normalize(q.imaginary_part())};
221}
222
223template<typename T> [[nodiscard]] inline QuaternionBase<T> conjugate(const QuaternionBase<T> &a)
224{
225 return {a.w, -a.x, -a.y, -a.z};
226}
227
228template<typename T>
230{
231 return (q.w < T(0)) ? -q : q;
232}
233
234template<typename T> [[nodiscard]] inline QuaternionBase<T> invert(const QuaternionBase<T> &q)
235{
236 const T length_squared = dot(q, q);
237 if (length_squared == T(0)) {
239 }
240 return conjugate(q) * (T(1) / length_squared);
241}
242
243template<typename T>
245{
247 return conjugate(q);
248}
249
250template<typename T>
252 T &out_length)
253{
254 out_length = math::sqrt(dot(q, q));
255 return (out_length != T(0)) ? (q * (T(1) / out_length)) : QuaternionBase<T>::identity();
256}
257
258template<typename T> [[nodiscard]] inline QuaternionBase<T> normalize(const QuaternionBase<T> &q)
259{
260 T len;
261 return normalize_and_get_length(q, len);
262}
263
272template<typename T>
273[[nodiscard]] inline VecBase<T, 2> interpolate_dot_slerp(const T t, const T cosom)
274{
275 const T eps = T(1e-4);
276
277 BLI_assert(IN_RANGE(t, 0.0, 1.0));
278 BLI_assert(IN_RANGE_INCL(cosom, T(-1.0001), T(1.0001)));
279
281 T abs_cosom = math::abs(cosom);
282 /* Within [-1..1] range, avoid aligned axis. */
283 if (abs_cosom < (T(1) - eps)) [[likely]] {
284 const T omega = math::acos(abs_cosom);
285 const T sinom = math::sin(omega);
286
287 w[0] = math::sin((T(1) - t) * omega) / sinom;
288 w[1] = math::sin(t * omega) / sinom;
289 }
290 else {
291 /* Fall back to lerp */
292 w[0] = T(1) - t;
293 w[1] = t;
294 }
295
296 /* Rotate around shortest angle. */
297 if (cosom < T(0)) {
298 w[0] = -w[0];
299 }
300 return w;
301}
302
303template<typename T>
304[[nodiscard]] inline QuaternionBase<T> interpolate(const QuaternionBase<T> &a,
305 const QuaternionBase<T> &b,
306 T t)
307{
310
311 /* Quaternion slerp for arbitrary interpolation factors. */
312 if (math::dot(a, b) < 0.0f) {
313 return a * math::pow(-math::invert_normalized(a) * b, t);
314 }
315 return a * math::pow(math::invert_normalized(a) * b, t);
316}
317
318template<typename T>
319[[nodiscard]] inline VecBase<T, 3> transform_point(const QuaternionBase<T> &q,
320 const VecBase<T, 3> &v)
321{
322#if 0 /* Reference. */
324 QuaternionBase<T> R = q * V * conjugate(q);
325 return {R.x, R.y, R.z};
326#else
327 /* `S = q * V`. */
329 S.w = /* q.w * 0.0 */ -q.x * v.x - q.y * v.y - q.z * v.z;
330 S.x = q.w * v.x /* + q.x * 0.0 */ + q.y * v.z - q.z * v.y;
331 S.y = q.w * v.y /* + q.y * 0.0 */ + q.z * v.x - q.x * v.z;
332 S.z = q.w * v.z /* + q.z * 0.0 */ + q.x * v.y - q.y * v.x;
333 /* `R = S * conjugate(q)`. */
335 /* `R.w = S.w * q.w + S.x * q.x + S.y * q.y + S.z * q.z = 0.0`. */
336 R.x = S.w * -q.x + S.x * q.w - S.y * q.z + S.z * q.y;
337 R.y = S.w * -q.y + S.y * q.w - S.z * q.x + S.x * q.z;
338 R.z = S.w * -q.z + S.z * q.w - S.x * q.y + S.y * q.x;
339 return R;
340#endif
341}
342
344
345/* -------------------------------------------------------------------- */
348
349/* -------------- Constructors -------------- */
350
351template<typename T>
358
359template<typename T>
361 const QuaternionBase<T> &dual,
362 const MatBase<T, 4, 4> &scale_mat)
363 : quat(non_dual), trans(dual), scale(scale_mat), scale_weight(1), quat_weight(1)
364{
365 BLI_assert(is_unit_scale(non_dual));
366}
367
368/* -------------- Operators -------------- */
369
370template<typename T>
372{
373 DualQuaternionBase<T> &a = *this;
374 /* Sum rotation and translation. */
375
376 /* Make sure we interpolate quaternions in the right direction. */
377 if (dot(a.quat, b.quat) < 0) {
378 a.quat.w -= b.quat.w;
379 a.quat.x -= b.quat.x;
380 a.quat.y -= b.quat.y;
381 a.quat.z -= b.quat.z;
382
383 a.trans.w -= b.trans.w;
384 a.trans.x -= b.trans.x;
385 a.trans.y -= b.trans.y;
386 a.trans.z -= b.trans.z;
387 }
388 else {
389 a.quat.w += b.quat.w;
390 a.quat.x += b.quat.x;
391 a.quat.y += b.quat.y;
392 a.quat.z += b.quat.z;
393
394 a.trans.w += b.trans.w;
395 a.trans.x += b.trans.x;
396 a.trans.y += b.trans.y;
397 a.trans.z += b.trans.z;
398 }
399
400 a.quat_weight += b.quat_weight;
401
402 if (b.scale_weight > T(0)) {
403 if (a.scale_weight > T(0)) {
404 /* Weighted sum of scale matrices (sum of components). */
405 a.scale += b.scale;
406 a.scale_weight += b.scale_weight;
407 }
408 else {
409 /* No existing scale. Replace. */
410 a.scale = b.scale;
411 a.scale_weight = b.scale_weight;
412 }
413 }
414 return *this;
415}
416
418{
419 BLI_assert(t >= 0);
420 DualQuaternionBase<T> &q = *this;
421
422 q.quat.w *= t;
423 q.quat.x *= t;
424 q.quat.y *= t;
425 q.quat.z *= t;
426
427 q.trans.w *= t;
428 q.trans.x *= t;
429 q.trans.y *= t;
430 q.trans.z *= t;
431
432 q.quat_weight *= t;
433
434 if (q.scale_weight > T(0)) {
435 q.scale *= t;
436 q.scale_weight *= t;
437 }
438 return *this;
439}
440
441/* -------------- Functions -------------- */
442
450template<typename T>
452{
453 const T norm_weighted = math::sqrt(dot(dual_quat.quat, dual_quat.quat));
454 /* NOTE(fclem): Should this be an epsilon? */
455 if (norm_weighted == T(0)) {
456 /* The dual-quaternion was zero initialized or is degenerate. Return identity. */
458 }
459
460 const T inv_norm_weighted = T(1) / norm_weighted;
461
462 DualQuaternionBase<T> dq = dual_quat;
463 dq.quat = dq.quat * inv_norm_weighted;
464 dq.trans = dq.trans * inv_norm_weighted;
465
466 /* Handle scale if needed. */
467 if (dq.scale_weight > T(0)) {
468 /* Compensate for any dual quaternions added without scale.
469 * This is an optimization so that we can skip the scale part when not needed. */
470 const float missing_uniform_scale = dq.quat_weight - dq.scale_weight;
471
472 if (missing_uniform_scale > T(0)) {
473 dq.scale[0][0] += missing_uniform_scale;
474 dq.scale[1][1] += missing_uniform_scale;
475 dq.scale[2][2] += missing_uniform_scale;
476 dq.scale[3][3] += missing_uniform_scale;
477 }
478 /* Per component scalar product. */
479 dq.scale *= T(1) / dq.quat_weight;
480 dq.scale_weight = T(1);
481 }
482 dq.quat_weight = T(1);
483 return dq;
484}
485
491template<typename T>
493 const VecBase<T, 3> &point,
494 MatBase<T, 3, 3> *r_crazy_space_mat = nullptr)
495{
504 /* Follow the paper notation. */
505 const T &w0 = dq.quat.w, &x0 = dq.quat.x, &y0 = dq.quat.y, &z0 = dq.quat.z;
506 const T &we = dq.trans.w, &xe = dq.trans.x, &ye = dq.trans.y, &ze = dq.trans.z;
507 /* Part 3.4 - The Final Algorithm. */
509 t[0] = T(2) * (-we * x0 + xe * w0 - ye * z0 + ze * y0);
510 t[1] = T(2) * (-we * y0 + xe * z0 + ye * w0 - ze * x0);
511 t[2] = T(2) * (-we * z0 - xe * y0 + ye * x0 + ze * w0);
512 /* Isolate rotation matrix to easily output crazy-space mat. */
514 M[0][0] = (w0 * w0) + (x0 * x0) - (y0 * y0) - (z0 * z0); /* Same as `1 - 2y0^2 - 2z0^2`. */
515 M[0][1] = T(2) * ((x0 * y0) + (w0 * z0));
516 M[0][2] = T(2) * ((x0 * z0) - (w0 * y0));
517
518 M[1][0] = T(2) * ((x0 * y0) - (w0 * z0));
519 M[1][1] = (w0 * w0) + (y0 * y0) - (x0 * x0) - (z0 * z0); /* Same as `1 - 2x0^2 - 2z0^2`. */
520 M[1][2] = T(2) * ((y0 * z0) + (w0 * x0));
521
522 M[2][1] = T(2) * ((y0 * z0) - (w0 * x0));
523 M[2][2] = (w0 * w0) + (z0 * z0) - (x0 * x0) - (y0 * y0); /* Same as `1 - 2x0^2 - 2y0^2`. */
524 M[2][0] = T(2) * ((x0 * z0) + (w0 * y0));
525
526 VecBase<T, 3> result = point;
527 /* Apply scaling. */
528 if (dq.scale_weight != T(0)) {
529 /* NOTE(fclem): This is weird that this is also adding translation even if it is marked as
530 * scale matrix. Follows the old C implementation for now... */
532 }
533 /* Apply rotation and translation. */
535 /* Compute crazy-space correction matrix. */
536 if (r_crazy_space_mat != nullptr) {
537 if (dq.scale_weight) {
538 *r_crazy_space_mat = M * dq.scale.template view<3, 3>();
539 }
540 else {
541 *r_crazy_space_mat = M;
542 }
543 }
544 return result;
545}
546
553template<typename T>
555 const MatBase<T, 4, 4> &basemat)
556{
569 using Mat4T = MatBase<T, 4, 4>;
570 using Vec3T = VecBase<T, 3>;
571
572 /* Split scaling and rotation.
573 * There is probably a faster way to do this. It is currently done like this to correctly get
574 * negative scaling. */
575 Mat4T baseRS = mat * basemat;
576
577 Mat4T R, scale;
578 const bool has_scale = !is_orthonormal(mat) || is_negative(mat) ||
579 length_squared(to_scale(baseRS) - T(1)) > square(1e-4f);
580 if (has_scale) {
581 /* Extract Rotation and Scale. */
582 const Mat4T baseinv = invert(basemat);
583
584 /* Extra orthogonalize, to avoid flipping with stretched bones. */
586
587 Mat4T baseR = from_rotation<Mat4T>(basequat);
588 baseR.location() = baseRS.location();
589
590 R = baseR * baseinv;
591
592 const Mat4T S = invert(baseR) * baseRS;
593 /* Set scaling part. */
594 scale = basemat * S * baseinv;
595 }
596 else {
597 /* Input matrix does not contain scaling. */
598 R = mat;
599 }
600
601 /* Non-dual part. */
603
604 /* Dual part. */
605 const Vec3T &t = R.location().xyz();
607 d.w = T(-0.5) * (+t.x * q.x + t.y * q.y + t.z * q.z);
608 d.x = T(+0.5) * (+t.x * q.w + t.y * q.z - t.z * q.y);
609 d.y = T(+0.5) * (-t.x * q.z + t.y * q.w + t.z * q.x);
610 d.z = T(+0.5) * (+t.x * q.y - t.y * q.x + t.z * q.w);
611
612 if (has_scale) {
613 return DualQuaternionBase<T>(q, d, scale);
614 }
615
616 return DualQuaternionBase<T>(q, d);
617}
618
620
621} // namespace math
622
623namespace math {
624
625/* -------------------------------------------------------------------- */
628
629template<typename T, typename AngleT = AngleRadian>
631{
633
634 VecBase<T, 3> axis = VecBase<T, 3>(quat.x, quat.y, quat.z);
635 T cos_half_angle = quat.w;
636 T sin_half_angle = math::length(axis);
637 /* Prevent division by zero for axis conversion. */
638 if (sin_half_angle < T(0.0005)) {
639 using AngleAxisT = typename AxisAngleBase<T, AngleT>::vec3_type;
640 const AngleAxisT identity_axis = AxisAngleBase<T, AngleT>::identity().axis();
641 BLI_assert(abs(cos_half_angle) > 0.0005);
642 AxisAngleBase<T, AngleT> identity(identity_axis * sign(cos_half_angle), AngleT(0));
643 return identity;
644 }
645 /* Normalize the axis. */
646 axis /= sin_half_angle;
647
648 /* Leverage AngleT implementation of double angle. */
649 AngleT angle = AngleT(cos_half_angle, sin_half_angle) * 2;
650
651 return AxisAngleBase<T, AngleT>(axis, angle);
652}
653
655
656/* -------------------------------------------------------------------- */
659
660template<typename T> EulerXYZBase<T> to_euler(const QuaternionBase<T> &quat)
661{
662 using Mat3T = MatBase<T, 3, 3>;
664 Mat3T unit_mat = from_rotation<Mat3T>(quat);
665 return to_euler<T>(unit_mat);
666}
667
668template<typename T> Euler3Base<T> to_euler(const QuaternionBase<T> &quat, EulerOrder order)
669{
670 using Mat3T = MatBase<T, 3, 3>;
672 Mat3T unit_mat = from_rotation<Mat3T>(quat);
673 return to_euler<T>(unit_mat, order);
674}
675
677
678/* -------------------------------------------------------------------- */
681
682/* Prototype needed to avoid interdependencies of headers. */
683template<typename T, typename AngleT>
684QuaternionBase<T> to_quaternion(const AxisAngleBase<T, AngleT> &axis_angle);
685
687{
688 using AxisAngleT = AxisAngleBase<T, AngleRadianBase<T>>;
689 /* Obtain axis/angle representation. */
690 T angle;
692 if (angle != T(0)) [[likely]] {
693 return to_quaternion(AxisAngleT(axis, AngleRadianBase<T>(angle).wrapped()));
694 }
696}
697
698template<typename T> VecBase<T, 3> QuaternionBase<T>::expmap() const
699{
700 using AxisAngleT = AxisAngleBase<T, AngleRadianBase<T>>;
702 const AxisAngleT axis_angle = to_axis_angle(*this);
703 return axis_angle.axis() * axis_angle.angle().radian();
704}
705
707
708} // namespace math
709} // namespace blender
#define IN_RANGE(a, b, c)
#define UNPACK3(a)
#define IN_RANGE_INCL(a, b, c)
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
Definition btQuadWord.h:119
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
Definition btVector3.h:356
constexpr int as_int() const
static constexpr Value Y
Quaternion to_quaternion(EulerXYZ eul)
ccl_device_inline dual1 len(const ccl_private dual< T > &a)
Definition math_dual.h:263
#define M
#define T
#define R
QuaternionBase< T > conjugate(const QuaternionBase< T > &a)
T length_squared(const VecBase< T, Size > &a)
T cos(const AngleRadianBase< T > &a)
T pow(const T &x, const T &power)
bool is_normalized(const DualQuaternionBase< T > &dq)
T acos(const T &a)
T sqrt(const T &a)
QuaternionBase< T > to_quaternion(const AxisAngleBase< T, AngleT > &axis_angle)
bool is_negative(const MatBase< T, 3, 3 > &mat)
MatBase< T, NumCol, NumRow > scale(const MatBase< T, NumCol, NumRow > &mat, const VectorT &scale)
bool is_orthonormal(const MatT &mat)
T sign(const T &a)
T length(const VecBase< T, Size > &a)
QuaternionBase< T > normalize_and_get_length(const QuaternionBase< T > &q, T &out_length)
bool is_unit_scale(const MatBase< T, NumCol, NumRow > &m)
T dot(const QuaternionBase< T > &a, const QuaternionBase< T > &b)
bool is_zero(const T &a)
CartesianBasis invert(const CartesianBasis &basis)
T interpolate(const T &a, const T &b, const FactorT &t)
T safe_acos(const T &a)
QuaternionBase< T > invert_normalized(const QuaternionBase< T > &q)
AxisAngleBase< T, AngleT > to_axis_angle(const EulerXYZBase< T > &euler)
MatBase< T, NumCol, NumRow > normalize(const MatBase< T, NumCol, NumRow > &a)
VecBase< T, 3 > to_scale(const MatBase< T, NumCol, NumRow > &mat)
QuaternionBase< T > canonicalize(const QuaternionBase< T > &q)
T square(const T &a)
T distance_squared(const VecBase< T, Size > &a, const VecBase< T, Size > &b)
bool is_equal(const MatBase< T, NumCol, NumRow > &a, const MatBase< T, NumCol, NumRow > &b, const T epsilon=T(0))
T sin(const AngleRadianBase< T > &a)
MatT orthogonalize(const MatT &mat, const Axis axis)
T abs(const T &a)
VecBase< T, 2 > interpolate_dot_slerp(const T t, const T cosom)
MatT from_rotation(const RotationT &rotation)
DualQuaternionBase< T > to_dual_quaternion(const MatBase< T, 4, 4 > &mat, const MatBase< T, 4, 4 > &basemat)
Euler3Base< T > to_euler(const AxisAngleBase< T, AngleT > &axis_angle, EulerOrder order)
VecBase< T, 3 > transform_point(const CartesianBasis &basis, const VecBase< T, 3 > &v)
BMesh Iterators.
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
ATTR_WARN_UNUSED_RESULT const BMVert * v
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
const btScalar eps
Definition poly34.cpp:11
static AngleCartesianBase from_point(const T &x, const T &y)
DualQuaternionBase & operator*=(const T &t) &
DualQuaternionBase & operator+=(const DualQuaternionBase &b) &
const VecBase< T, 3 > & imaginary_part() const
QuaternionBase swing(const Axis axis) const
AngleRadianBase< T > twist_angle(const Axis axis) const
QuaternionBase twist(const Axis axis) const
QuaternionBase wrapped_around(const QuaternionBase &reference) const
static QuaternionBase expmap(const VecBase< T, 3 > &expmap)
CCL_NAMESPACE_BEGIN struct Window V