amino  1.0-beta2
Lightweight Robot Utility Library
spatial.hpp
Go to the documentation of this file.
1 /* -*- mode: C++; c-basic-offset: 4 -*- */
2 /* ex: set shiftwidth=4 tabstop=4 expandtab: */
3 /*
4  * Copyright (c) 2013, Georgia Tech Research Corporation
5  * All rights reserved.
6  *
7  * Author(s): Neil T. Dantam <ntd@gatech.edu>
8  * Georgia Tech Humanoid Robotics Lab
9  * Under Direction of Prof. Mike Stilman <mstilman@cc.gatech.edu>
10  *
11  *
12  * This file is provided under the following "BSD-style" License:
13  *
14  *
15  * Redistribution and use in source and binary forms, with or
16  * without modification, are permitted provided that the following
17  * conditions are met:
18  *
19  * * Redistributions of source code must retain the above copyright
20  * notice, this list of conditions and the following disclaimer.
21  *
22  * * Redistributions in binary form must reproduce the above
23  * copyright notice, this list of conditions and the following
24  * disclaimer in the documentation and/or other materials provided
25  * with the distribution.
26  *
27  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
28  * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
29  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
30  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
31  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
32  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
33  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
34  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
35  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
36  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
37  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
38  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
39  * POSSIBILITY OF SUCH DAMAGE.
40  *
41  */
42 
43 #ifndef AA_TF_SPATIAL_HPP
44 #define AA_TF_SPATIAL_HPP
45 
59 namespace amino {
60 
64 struct Vec3 : aa_tf_vec3 {
65  Vec3() {}
66 
70  Vec3(const struct aa_tf_duqu *S) : aa_tf_vec3(from_duqu(S->data)) {}
71 
75  Vec3(const struct aa_tf_duqu &S) : aa_tf_vec3(from_duqu(S.data)) {}
76 
80  Vec3(const struct aa_tf_tfmat *T) : aa_tf_vec3(from_tfmat(T->data)) {}
81 
85  Vec3(const struct aa_tf_tfmat &T) : aa_tf_vec3(from_tfmat(T.data)) {}
86 
90  Vec3(double _x, double _y, double _z) : aa_tf_vec3(from_xyz(_x, _y, _z)) {}
91 
95  Vec3(const double *_xyz) : aa_tf_vec3(from_vec3(_xyz)) {}
96 
100  Vec3(const aa_tf_vec3 &src) : aa_tf_vec3(src) {}
101 
105  static aa_tf_vec3 from_xyz(double x, double y, double z)
106  {
107  aa_tf_vec3 V;
108  V.x = x;
109  V.y = y;
110  V.z = z;
111  return V;
112  }
113 
117  static aa_tf_vec3 from_vec3(const double a_x[3])
118  {
119  aa_tf_vec3 V;
120  memcpy(V.data, a_x, 3 * sizeof(V.data[0]));
121  return V;
122  }
123 
127  static aa_tf_vec3 from_duqu(const double S[8])
128  {
129  aa_tf_vec3 V;
130  aa_tf_duqu_trans(S, V.data);
131  return V;
132  }
133 
137  static aa_tf_vec3 from_tfmat(const double T[12])
138  {
139  return from_vec3(T + 9);
140  }
141 };
142 
143 /*------------------------------*/
144 /*-------- ORIENTATIONS --------*/
145 /*------------------------------*/
146 
150 struct XAngle {
151  double value;
152 
154  XAngle(double v) : value(v) {}
155 };
156 
160 struct YAngle {
161  double value;
162 
164  YAngle(double v) : value(v) {}
165 };
166 
170 struct ZAngle {
171  double value;
172 
174  ZAngle(double v) : value(v) {}
175 };
176 
180 struct Quat : aa_tf_quat {
184  Quat() : aa_tf_quat(from_xyzw(0, 0, 0, 1)) {}
185 
190 
195 
200 
205 
210 
215 
219  Quat(const XAngle &p) : aa_tf_quat(from_xangle(p.value)) {}
220 
224  Quat(const YAngle &p) : aa_tf_quat(from_yangle(p.value)) {}
225 
229  Quat(const ZAngle &p) : aa_tf_quat(from_zangle(p.value)) {}
230 
234  void rotate(const aa_tf_vec3 *p, aa_tf_vec3 *q) const
235  {
236  aa_tf_qrot(this->data, p->data, q->data);
237  }
238 
242  aa_tf_vec3 rotate(const aa_tf_vec3 &p) const
243  {
244  aa_tf_vec3 q;
245  this->rotate(&p, &q);
246  return q;
247  }
248 
252  static aa_tf_quat from_quat(const double x[4])
253  {
254  aa_tf_quat y;
255  memcpy(y.data, x, 4 * sizeof(y.data[0]));
256  return y;
257  }
258 
262  static aa_tf_quat from_xyzw(double x, double y, double z, double w)
263  {
264  aa_tf_quat q;
265  q.x = x;
266  q.y = y;
267  q.z = z;
268  q.w = w;
269  return q;
270  }
271 
275  static aa_tf_quat from_rotmat(const double x[9])
276  {
277  aa_tf_quat y;
278  aa_tf_rotmat2quat(x, y.data);
279  return y;
280  }
281 
285  static aa_tf_quat from_axang(const double x[4])
286  {
287  aa_tf_quat y;
288  aa_tf_axang2quat(x, y.data);
289  return y;
290  }
291 
295  static aa_tf_quat from_axang(const double a[3], double angle)
296  {
297  double x[4] = {a[0], a[1], a[2], angle};
298  return from_axang(x);
299  }
300 
304  static aa_tf_quat from_rotvec(const double x[3])
305  {
306  aa_tf_quat y;
307  aa_tf_rotvec2quat(x, y.data);
308  return y;
309  }
310 
314  static aa_tf_quat from_xangle(const double v)
315  {
316  aa_tf_quat y;
317  aa_tf_xangle2quat(v, y.data);
318  return y;
319  }
320 
324  static aa_tf_quat from_yangle(const double v)
325  {
326  aa_tf_quat y;
327  aa_tf_yangle2quat(v, y.data);
328  return y;
329  }
330 
334  static aa_tf_quat from_zangle(const double v)
335  {
336  aa_tf_quat y;
337  aa_tf_zangle2quat(v, y.data);
338  return y;
339  }
340 };
341 
349  RotMat() : aa_tf_rotmat(from_rotmat(1, 0, 0, 0, 1, 0, 0, 0, 1)) {}
350 
355 
360 
365 
370 
375 
380 
384  RotMat(const XAngle &p) : aa_tf_rotmat(from_xangle(p.value)) {}
385 
389  RotMat(const YAngle &p) : aa_tf_rotmat(from_yangle(p.value)) {}
390 
394  RotMat(const ZAngle &p) : aa_tf_rotmat(from_zangle(p.value)) {}
395 
399  RotMat(double r11, double r12, double r13, double r21, double r22,
400  double r23, double r31, double r32, double r33)
401  : aa_tf_rotmat(from_rotmat(r11, r12, r13, r21, r22, r23, r31, r32, r33))
402  {
403  }
404 
408  static aa_tf_rotmat from_rotmat(double r11, double r12, double r13,
409  double r21, double r22, double r23,
410  double r31, double r32, double r33)
411  {
412  aa_tf_rotmat R;
413  R.data[0] = r11;
414  R.data[1] = r21;
415  R.data[2] = r31;
416 
417  R.data[3] = r12;
418  R.data[4] = r22;
419  R.data[5] = r32;
420 
421  R.data[6] = r13;
422  R.data[7] = r23;
423  R.data[8] = r33;
424  return R;
425  }
426 
430  static aa_tf_rotmat from_quat(const double x[4])
431  {
432  aa_tf_rotmat y;
433  aa_tf_quat2rotmat(x, y.data);
434  return y;
435  }
436 
440  static aa_tf_rotmat from_rotmat(const double x[9])
441  {
442  aa_tf_rotmat y;
443  memcpy(y.data, x, 9 * sizeof(y.data[0]));
444  return y;
445  }
446 
450  static aa_tf_rotmat from_axang(const double x[4])
451  {
452  aa_tf_rotmat y;
453  aa_tf_axang2rotmat(x, y.data);
454  return y;
455  }
456 
460  static aa_tf_rotmat from_rotvec(const double x[3])
461  {
462  aa_tf_rotmat y;
464  return y;
465  }
466 
470  static aa_tf_rotmat from_xangle(const double v)
471  {
472  aa_tf_rotmat y;
474  return y;
475  }
476 
480  static aa_tf_rotmat from_yangle(const double v)
481  {
482  aa_tf_rotmat y;
484  return y;
485  }
486 
490  static aa_tf_rotmat from_zangle(const double v)
491  {
492  aa_tf_rotmat y;
494  return y;
495  }
496 };
497 
505  AxisAngle() : aa_tf_axang(from_axang(0, 0, 1, 0)) {}
506 
510  AxisAngle(const aa_tf_quat *p) : aa_tf_axang(from_quat(p->data)) {}
511 
515  AxisAngle(const aa_tf_quat &p) : aa_tf_axang(from_quat(p.data)) {}
516 
521 
526 
530  AxisAngle(const aa_tf_axang *p) : aa_tf_axang(from_axang(p->data)) {}
531 
535  AxisAngle(const aa_tf_axang &p) : aa_tf_axang(from_axang(p.data)) {}
536 
540  AxisAngle(double x, double y, double z, double theta)
541  : aa_tf_axang(from_axang(x, y, z, theta))
542  {
543  }
544 
548  AxisAngle(const double *_axis, double _angle)
549  : aa_tf_axang(from_axang(_axis, _angle))
550  {
551  }
552 
556  static aa_tf_axang from_quat(const double x[4])
557  {
558  aa_tf_axang y;
559  aa_tf_quat2axang(x, y.data);
560  return y;
561  }
562 
566  static aa_tf_axang from_rotmat(const double x[9])
567  {
568  aa_tf_axang y;
569  aa_tf_rotmat2axang(x, y.data);
570  return y;
571  }
572 
576  static aa_tf_axang from_axang(double x, double y, double z, double theta)
577  {
578  double n = sqrt(x * x + y * y + z * z);
579  double a[4] = {x / n, y / n, z / n, theta};
580  return from_axang(a);
581  }
582 
586  static aa_tf_axang from_axang(const double x[4])
587  {
588  aa_tf_axang y;
589  memcpy(y.data, x, 4 * sizeof(y.data[0]));
590  return y;
591  }
592 
596  static aa_tf_axang from_axang(const double axis[3], double angle)
597  {
598  aa_tf_axang y;
599  y.axis.x = axis[0];
600  y.axis.y = axis[1];
601  y.axis.z = axis[2];
602  y.angle = angle;
603  return y;
604  }
605 
609  static aa_tf_axang from_rotvec(const double x[3])
610  {
611  aa_tf_axang y;
612  aa_tf_rotvec2axang(x, y.data);
613  return y;
614  }
615 };
616 
617 /*-----------------------------*/
618 /*------ TRANSFORMATIONS ------*/
619 /*-----------------------------*/
620 
628  DualQuat() : aa_tf_duqu(from_xyzw(0, 0, 0, 1, 0, 0, 0, 0)) {}
629 
633  DualQuat(const double *S) : aa_tf_duqu(from_duqu(S)) {}
634 
638  DualQuat(const struct aa_tf_duqu *S) : aa_tf_duqu(from_duqu(S->data)) {}
639 
643  DualQuat(const struct aa_tf_duqu &S) : aa_tf_duqu(from_duqu(S.data)) {}
644 
648  DualQuat(const struct aa_tf_qv *S)
649  : aa_tf_duqu(from_qv(S->r.data, S->v.data))
650  {
651  }
652 
656  DualQuat(const struct aa_tf_qv &S) : aa_tf_duqu(from_qv(S.r.data, S.v.data))
657  {
658  }
659 
663  DualQuat(const struct aa_tf_quat *r, const struct aa_tf_vec3 *v)
664  : aa_tf_duqu(from_qv(r->data, v->data))
665  {
666  }
667 
671  DualQuat(const struct aa_tf_quat &r, const struct aa_tf_vec3 &v)
672  : aa_tf_duqu(from_qv(r.data, v.data))
673  {
674  }
675 
679  DualQuat(const struct aa_tf_tfmat *T) : aa_tf_duqu(from_tfmat(T->data)) {}
680 
684  DualQuat(const struct aa_tf_tfmat &T) : aa_tf_duqu(from_tfmat(T.data)) {}
685 
689  DualQuat(const XAngle &r, const struct aa_tf_vec3 &v)
690  : aa_tf_duqu(from_xxyz(r.value, v.x, v.y, v.z))
691  {
692  }
693 
697  DualQuat(const YAngle &r, const struct aa_tf_vec3 &v)
698  : aa_tf_duqu(from_yxyz(r.value, v.x, v.y, v.z))
699  {
700  }
701 
705  DualQuat(const ZAngle &r, const struct aa_tf_vec3 &v)
706  : aa_tf_duqu(from_zxyz(r.value, v.x, v.y, v.z))
707  {
708  }
709 
713  DualQuat(const struct aa_tf_vec3 &v) : aa_tf_duqu(from_xyz(v.x, v.y, v.z))
714  {
715  }
716 
720  DualQuat(const aa_tf_axang &r, const struct aa_tf_vec3 &v)
721  : aa_tf_duqu(from_qv(Quat::from_axang(r.data).data, v.data))
722  {
723  }
724 
729  {
730  DualQuat S;
731  aa_tf_duqu_conj(this->data, S.data);
732  return S;
733  }
734 
739  {
740  aa_tf_vec3 V;
741  aa_tf_duqu_trans(this->data, V.data);
742  return V;
743  }
744 
748  static aa_tf_duqu from_xyzw(double x_real, double y_real, double z_real,
749  double w_real, double x_dual, double y_dual,
750  double z_dual, double w_dual)
751  {
752  DualQuat S;
753  S.real = Quat::from_xyzw(x_real, y_real, z_real, w_real);
754  S.dual = Quat::from_xyzw(x_dual, y_dual, z_dual, w_dual);
755  return S;
756  }
757 
761  static aa_tf_duqu from_duqu(const double s[8])
762  {
763  DualQuat S;
764  memcpy(S.data, s, 8 * sizeof(s[0]));
765  return S;
766  }
767 
772  static aa_tf_duqu from_qv(const double q[4], const double v[3])
773  {
774  DualQuat S;
775  aa_tf_qv2duqu(q, v, S.data);
776  return S;
777  }
778 
782  static aa_tf_duqu from_tfmat(const double T[12])
783  {
784  DualQuat S;
785  aa_tf_tfmat2duqu(T, S.data);
786  return S;
787  }
788 
792  static aa_tf_duqu from_xxyz(double theta, double x, double y, double z)
793  {
794  DualQuat S;
795  aa_tf_xxyz2duqu(theta, x, y, z, S.data);
796  return S;
797  }
798 
802  static aa_tf_duqu from_yxyz(double theta, double x, double y, double z)
803  {
804  DualQuat S;
805  aa_tf_yxyz2duqu(theta, x, y, z, S.data);
806  return S;
807  }
808 
812  static aa_tf_duqu from_zxyz(double theta, double x, double y, double z)
813  {
814  DualQuat S;
815  aa_tf_zxyz2duqu(theta, x, y, z, S.data);
816  return S;
817  }
818 
823  static aa_tf_duqu from_xyz(double x, double y, double z)
824  {
825  DualQuat S;
826  aa_tf_xyz2duqu(x, y, z, S.data);
827  return S;
828  }
829 
834  static aa_tf_duqu from_dx(double *s, double *dx)
835  {
836  DualQuat S;
837  aa_tf_duqu_vel2diff(s, dx, S.data);
838  return S;
839  }
840 };
841 
845 struct QuatTran : aa_tf_qv {
849  QuatTran() : aa_tf_qv(from_xyzw(0, 0, 0, 1, 0, 0, 0)) {}
850 
854  QuatTran(const struct aa_tf_qv *S) : aa_tf_qv(from_qv(S->r.data, S->v.data))
855  {
856  }
857 
861  QuatTran(const struct aa_tf_qv &S) : aa_tf_qv(from_qv(S.r.data, S.v.data))
862  {
863  }
864 
868  QuatTran(const struct aa_tf_quat *_r, const struct aa_tf_vec3 *_v)
869  : aa_tf_qv(from_qv(_r->data, _v->data))
870  {
871  }
872 
876  QuatTran(const struct aa_tf_quat &_r, const struct aa_tf_vec3 &_v)
877  : aa_tf_qv(from_qv(_r.data, _v.data))
878  {
879  }
880 
884  QuatTran(const struct XAngle &_r, const struct aa_tf_vec3 &_v)
885  : aa_tf_qv(from_qv(Quat(_r).data, _v.data))
886  {
887  }
888 
892  QuatTran(const struct YAngle &_r, const struct aa_tf_vec3 &_v)
893  : aa_tf_qv(from_qv(Quat(_r).data, _v.data))
894  {
895  }
896 
900  QuatTran(const struct ZAngle &_r, const struct aa_tf_vec3 &_v)
901  : aa_tf_qv(from_qv(Quat(_r).data, _v.data))
902  {
903  }
904 
908  QuatTran(const struct aa_tf_duqu *S) : aa_tf_qv(from_duqu(S->data)) {}
909 
913  QuatTran(const struct aa_tf_duqu &S) : aa_tf_qv(from_duqu(S.data)) {}
914 
918  QuatTran(const struct aa_tf_tfmat *T) : aa_tf_qv(from_tfmat(T->data)) {}
919 
923  QuatTran(const struct aa_tf_tfmat &T) : aa_tf_qv(from_tfmat(T.data)) {}
924 
929  {
930  aa_tf_qv qv;
931  aa_tf_qutr_conj(this->data, qv.data);
932  return qv;
933  }
934 
938  static aa_tf_qv from_xyzw(double q_x, double q_y, double q_z, double q_w,
939  double t_x, double t_y, double t_z)
940  {
941  aa_tf_qv qv;
942  qv.r = Quat::from_xyzw(q_x, q_y, q_z, q_w);
943  qv.v = Vec3::from_xyz(t_x, t_y, t_z);
944  return qv;
945  }
946 
951  static aa_tf_qv from_qv(const double a_r[4], const double a_v[3])
952  {
953  aa_tf_qv qv;
954  memcpy(qv.r.data, a_r, 4 * sizeof(qv.r.data[0]));
955  memcpy(qv.v.data, a_v, 3 * sizeof(qv.v.data[0]));
956  return qv;
957  }
958 
963  static aa_tf_qv from_qv(const double e[7]) { return from_qv(e, e + 4); }
964 
968  static aa_tf_qv from_duqu(const double s[8])
969  {
970  aa_tf_qv qv;
971  aa_tf_duqu2qv(s, qv.r.data, qv.v.data);
972  return qv;
973  }
974 
978  static aa_tf_qv from_tfmat(const double t[12])
979  {
980  aa_tf_qv qv;
981  aa_tf_tfmat2duqu(t, qv.data);
982  return qv;
983  }
984 
988  void transform(const double a[3], double b[3]) const
989  {
990  aa_tf_qutr_tf(this->data, a, b);
991  }
992 
996  void transform(const aa_tf_vec3 *a, aa_tf_vec3 *b) const
997  {
998  this->transform(a->data, b->data);
999  }
1000 
1005  {
1006  aa_tf_vec3 b;
1007  this->transform(&a, &b);
1008  return b;
1009  }
1010 };
1011 
1015 struct TfMat : aa_tf_tfmat {
1020 
1024  TfMat(const struct aa_tf_tfmat *T) : aa_tf_tfmat(from_tfmat(T->data)) {}
1025 
1029  TfMat(const struct aa_tf_tfmat &T) : aa_tf_tfmat(from_tfmat(T.data)) {}
1030 
1034  TfMat(const struct aa_tf_duqu *S) : aa_tf_tfmat(from_duqu(S->data)) {}
1035 
1039  TfMat(const struct aa_tf_duqu &S) : aa_tf_tfmat(from_duqu(S.data)) {}
1040 
1044  TfMat(const struct aa_tf_qv *S) : aa_tf_tfmat(from_qv(S->r.data, S->v.data))
1045  {
1046  }
1047 
1051  TfMat(const struct aa_tf_qv &S) : aa_tf_tfmat(from_qv(S.r.data, S.v.data))
1052  {
1053  }
1054 
1058  TfMat(const struct aa_tf_quat *_r, const struct aa_tf_vec3 *_v)
1059  : aa_tf_tfmat(from_qv(_r->data, _v->data))
1060  {
1061  }
1062 
1066  TfMat(const struct aa_tf_quat &_r, const struct aa_tf_vec3 &_v)
1067  : aa_tf_tfmat(from_qv(_r.data, _v.data))
1068  {
1069  }
1070 
1074  static aa_tf_tfmat from_duqu(const double s[8])
1075  {
1076  aa_tf_tfmat T;
1077  aa_tf_duqu2tfmat(s, T.data);
1078  return T;
1079  }
1080 
1085  static aa_tf_tfmat from_qv(const double q[4], const double v[3])
1086  {
1087  aa_tf_tfmat T;
1088  aa_tf_qv2tfmat(q, v, T.data);
1089  return T;
1090  }
1091 
1095  static aa_tf_tfmat from_tfmat(const double t[12])
1096  {
1097  aa_tf_tfmat T;
1098  memcpy(T.data, t, 12 * sizeof(T.data[0]));
1099  return T;
1100  }
1101 
1105  void transform(const double a[3], double b[3]) const
1106  {
1107  aa_tf_tfmat_tf(this->data, a, b);
1108  }
1109 
1113  void transform(const aa_tf_vec3 *a, aa_tf_vec3 *b) const
1114  {
1115  this->transform(a->data, b->data);
1116  }
1117 
1122  {
1123  aa_tf_vec3 b;
1124  this->transform(&a, &b);
1125  return b;
1126  }
1127 };
1128 
1129 /*---- OPERATORS -----*/
1130 
1134 static inline struct aa_tf_vec3 operator+(const struct aa_tf_vec3 &a,
1135  const struct aa_tf_vec3 &b)
1136 {
1137  struct aa_tf_vec3 c;
1138  c.x = a.x + b.x;
1139  c.y = a.y + b.y;
1140  c.z = a.z + b.z;
1141  return c;
1142 }
1143 
1147 static inline struct aa_tf_vec3 operator/(const struct aa_tf_vec3 &a, double b)
1148 {
1149  struct aa_tf_vec3 c;
1150  c.x = a.x / b;
1151  c.y = a.y / b;
1152  c.z = a.z / b;
1153  return c;
1154 }
1155 
1159 static inline struct aa_tf_rotmat operator*(const struct aa_tf_rotmat &a,
1160  const struct aa_tf_rotmat &b)
1161 {
1162  struct aa_tf_rotmat c;
1163  aa_tf_9mul(a.data, b.data, c.data);
1164  return c;
1165 }
1166 
1170 static inline struct aa_tf_quat operator*(const struct aa_tf_quat &a,
1171  const struct aa_tf_quat &b)
1172 {
1173  struct aa_tf_quat c;
1174  aa_tf_qmul(a.data, b.data, c.data);
1175  return c;
1176 }
1177 
1181 static inline struct aa_tf_tfmat operator*(const struct aa_tf_tfmat &a,
1182  const struct aa_tf_tfmat &b)
1183 {
1184  struct aa_tf_tfmat c;
1185  aa_tf_12chain(a.data, b.data, c.data);
1186  return c;
1187 }
1188 
1192 static inline struct aa_tf_duqu operator*(const struct aa_tf_duqu &a,
1193  const struct aa_tf_duqu &b)
1194 {
1195  struct aa_tf_duqu c;
1196  aa_tf_duqu_mul(a.data, b.data, c.data);
1197  return c;
1198 }
1199 
1207 static inline struct aa_tf_qv operator*(const struct aa_tf_qv &a,
1208  const struct aa_tf_qv &b)
1209 {
1210  struct aa_tf_qv c;
1211  aa_tf_qv_chain(a.r.data, a.v.data, b.r.data, b.v.data, c.r.data, c.v.data);
1212  return c;
1213 }
1214 
1218 static inline struct aa_tf_vec3 operator*(const struct aa_tf_rotmat &r,
1219  const struct aa_tf_vec3 &p)
1220 {
1221  struct aa_tf_vec3 q;
1222  aa_tf_rotmat_rot(r.data, p.data, q.data);
1223  return q;
1224 }
1225 
1226 } // namespace amino
1227 
1228 #endif
amino namespace
Definition: amino.hpp:60
AA_API void aa_tf_duqu_conj(const double d[AA_RESTRICT 8], double dconj[AA_RESTRICT 8])
Dual quaternion conjugate.
static const double aa_tf_ident[12]
Identity transformation matrix array.
Definition: spatial.h:203
AA_API void aa_tf_quat2axang(const double q[AA_RESTRICT 4], double axang[AA_RESTRICT 4])
Quaternion to axis-angle.
AA_API void aa_tf_xangle2rotmat(double theta_x, double R[AA_RESTRICT 9])
Angle about x axis.
AA_API void aa_tf_rotmat_rot(const double R[AA_RESTRICT 9], const double p0[AA_RESTRICT 3], double p1[AA_RESTRICT 3])
Rotate a point using a rotation matrix.
AA_API void aa_tf_quat2rotmat(const double quat[AA_RESTRICT 4], double rotmat[AA_RESTRICT 9])
convert quaternion to rotation matrix
AA_API void aa_tf_zxyz2duqu(double theta, double x, double y, double z, double d[AA_RESTRICT 8])
Convert z angle and translation to dual quaternion.
AA_API void aa_tf_qrot(const double q[AA_RESTRICT 4], const double v[AA_RESTRICT 3], double p[AA_RESTRICT 3])
Quaternion point rotation.
AA_API void aa_tf_duqu2qv(const double d[AA_RESTRICT 8], double q[AA_RESTRICT 4], double v[AA_RESTRICT 3])
Convert dual quaternion to orientation unit quaternion and translation vector.
AA_API void aa_tf_yangle2rotmat(double theta_y, double R[AA_RESTRICT 9])
Angle about y axis.
AA_API void aa_tf_duqu_trans(const double d[AA_RESTRICT 8], double v[AA_RESTRICT 3])
Extract dual quaternion translation vector.
AA_API void aa_tf_qutr_tf(const double E[AA_RESTRICT 7], const double p0[AA_RESTRICT 3], double p1[AA_RESTRICT 3])
Transform a point,.
AA_API void aa_tf_duqu2tfmat(const double d[AA_RESTRICT 8], double T[AA_RESTRICT 12])
Convert dual quaternion to transformation matrix.
AA_API void aa_tf_qutr_conj(const double a[7], double c[7])
quaternion-translation conjugate
AA_API void aa_tf_qv_chain(const double q0[AA_RESTRICT 4], const double v0[AA_RESTRICT 3], const double q1[AA_RESTRICT 4], const double v1[AA_RESTRICT 3], double q[AA_RESTRICT 4], double v[AA_RESTRICT 3])
chain two transforms
AA_API void aa_tf_qmul(const double a[AA_RESTRICT 4], const double b[AA_RESTRICT 4], double c[AA_RESTRICT 4])
Quaternion multiplication.
AA_API void aa_tf_rotmat2axang(const double R[AA_RESTRICT 9], double ra[AA_RESTRICT 4])
convert rotation matrix to axis angle
AA_API void aa_tf_axang2quat(const double axang[AA_RESTRICT 4], double q[AA_RESTRICT 4])
axis-angle to quaternion.
AA_API void aa_tf_qv2duqu(const double q[AA_RESTRICT 4], const double v[AA_RESTRICT 3], double d[AA_RESTRICT 8])
Convert orientation unit quaternion and translation vector to dual quaternion.
AA_API void aa_tf_duqu_mul(const double d1[AA_RESTRICT 8], const double d2[AA_RESTRICT 8], double d3[AA_RESTRICT 8])
Dual quaternion multiplication.
AA_API void aa_tf_duqu_vel2diff(const double d[AA_RESTRICT 8], const double dx[AA_RESTRICT 6], double dd[AA_RESTRICT 8])
Dual quaternion derivative from velocity.
AA_API void aa_tf_zangle2rotmat(double theta_z, double R[AA_RESTRICT 9])
Angle about z axis.
AA_API void aa_tf_xangle2quat(double theta_x, double q[AA_RESTRICT 4])
Unit quaternion for angle about x axis.
AA_API void aa_tf_9mul(const double R0[AA_RESTRICT 9], const double R1[AA_RESTRICT 9], double R[AA_RESTRICT 9])
Multiply two rotation matrices.
AA_API void aa_tf_12chain(const double T1[AA_RESTRICT 12], const double T2[AA_RESTRICT 12], double T[AA_RESTRICT 12])
chain two transforms
AA_API void aa_tf_rotmat2quat(const double rotmat[AA_RESTRICT 9], double quat[AA_RESTRICT 4])
convert rotation matrix to quaternion
AA_API void aa_tf_axang2rotmat(const double ra[AA_RESTRICT 4], double R[AA_RESTRICT 9])
convert axis angle to rotation matrix
AA_API void aa_tf_rotvec2rotmat(const double rv[AA_RESTRICT 3], double R[AA_RESTRICT 9])
convert rotatoin vector to rotation matrix
AA_API void aa_tf_yxyz2duqu(double theta, double x, double y, double z, double d[AA_RESTRICT 8])
Convert y angle and translation to dual quaternion.
AA_API void aa_tf_xyz2duqu(double x, double y, double z, double d[AA_RESTRICT 8])
Pure translation dual quaternion.
AA_API void aa_tf_rotvec2quat(const double rotvec[AA_RESTRICT 3], double q[AA_RESTRICT 4])
covert rotation vector to quaternion
AA_API void aa_tf_zangle2quat(double theta_z, double q[AA_RESTRICT 4])
Unit quaternion for angle about z axis.
AA_API void aa_tf_yangle2quat(double theta_y, double q[AA_RESTRICT 4])
Unit quaternion for angle about y axis.
AA_API void aa_tf_tfmat2duqu(const double T[AA_RESTRICT 12], double d[AA_RESTRICT 8])
Convert transformation matrix to dual quaternion.
AA_API void aa_tf_xxyz2duqu(double theta, double x, double y, double z, double d[AA_RESTRICT 8])
Convert x angle and translation to dual quaternion.
AA_API void aa_tf_rotvec2axang(const double rotvec[AA_RESTRICT 3], double axang[AA_RESTRICT 4])
convert rotation vector to axis-angle
AA_API void aa_tf_tfmat_tf(const double T[AA_RESTRICT 12], const double p0[AA_RESTRICT 3], double p1[AA_RESTRICT 3])
Transform a point using a transformation matrix.
AA_API void aa_tf_qv2tfmat(const double q[AA_RESTRICT 4], const double v[AA_RESTRICT 3], double T[AA_RESTRICT 12])
Convert orientation unit quaternion and translation vector to transformation matrix.
Memory layout for axis-Angle rotation in x,y,z,angle order.
Definition: type.h:157
Memory layout for a dual quaternion.
Definition: type.h:283
double data[8]
data array
Definition: type.h:289
Memory layout for a quaternion, x,y,z,w order.
Definition: type.h:189
double v[3]
vector part
Definition: type.h:200
double x
x component
Definition: type.h:192
double data[4]
data array
Definition: type.h:204
double z
z component
Definition: type.h:194
double w
w component
Definition: type.h:195
double y
y component
Definition: type.h:193
Memory layout for a Transformation as rotation quaternion and translation vector.
Definition: type.h:270
double data[7]
data array
Definition: type.h:276
aa_tf_vec3_t v
translation vector
Definition: type.h:274
aa_tf_quat_t r
rotation unit quaternion
Definition: type.h:273
Memory layout for a rotation matrix.
Definition: type.h:140
double data[9]
data array
Definition: type.h:147
Memory layout for a transformation matrix.
Definition: type.h:232
double data[12]
data array
Definition: type.h:238
aa_tf_vec3_t v
the origin vector part
Definition: type.h:236
Memory layout for a vector of length 3.
Definition: type.h:124
double data[3]
data array
Definition: type.h:131
double y
y component
Definition: type.h:128
double x
x component
Definition: type.h:127
double z
z component
Definition: type.h:129
An axis-angle object.
Definition: spatial.hpp:501
static aa_tf_axang from_rotmat(const double x[9])
Create an axis angle from a rotation matrix.
Definition: spatial.hpp:566
static aa_tf_axang from_rotvec(const double x[3])
Create an axis angle from a rotation vector.
Definition: spatial.hpp:609
AxisAngle(const aa_tf_axang &p)
Construct an axis-angle from another axis-angle.
Definition: spatial.hpp:535
AxisAngle(double x, double y, double z, double theta)
Construct an axis-angle from individual components.
Definition: spatial.hpp:540
AxisAngle(const aa_tf_rotmat *p)
Construct an axis-angle from a rotation matrix.
Definition: spatial.hpp:520
AxisAngle()
Construct an idenity axis-angle.
Definition: spatial.hpp:505
static aa_tf_axang from_axang(double x, double y, double z, double theta)
Create an axis angle from individual components.
Definition: spatial.hpp:576
AxisAngle(const aa_tf_quat *p)
Construct an axis-angle from a unit quaternion.
Definition: spatial.hpp:510
AxisAngle(const double *_axis, double _angle)
Construct an axis-angle from an axis array and an angle.
Definition: spatial.hpp:548
static aa_tf_axang from_quat(const double x[4])
Create an axis angle from a unit quaternion.
Definition: spatial.hpp:556
AxisAngle(const aa_tf_quat &p)
Construct an axis-angle from a unit quaternion.
Definition: spatial.hpp:515
AxisAngle(const aa_tf_axang *p)
Construct an axis-angle from another axis-angle.
Definition: spatial.hpp:530
AxisAngle(const aa_tf_rotmat &p)
Construct an axis-angle from a rotation matrix.
Definition: spatial.hpp:525
static aa_tf_axang from_axang(const double axis[3], double angle)
Create an axis angle from an axis array and an angle.
Definition: spatial.hpp:596
static aa_tf_axang from_axang(const double x[4])
Create an axis angle from an axis angle array.
Definition: spatial.hpp:586
A dual quaternion object.
Definition: spatial.hpp:624
DualQuat(const struct aa_tf_tfmat *T)
Construct from a transformation matrix.
Definition: spatial.hpp:679
static aa_tf_duqu from_qv(const double q[4], const double v[3])
Create a dual quaternion from a rotation quaternion and a translation vector.
Definition: spatial.hpp:772
DualQuat(const struct aa_tf_tfmat &T)
Construct from a transformation matrix.
Definition: spatial.hpp:684
static aa_tf_duqu from_yxyz(double theta, double x, double y, double z)
Create a dual quaternion an Y axis rotation and translation components.
Definition: spatial.hpp:802
DualQuat(const struct aa_tf_duqu *S)
Construct from another dual quaternion.
Definition: spatial.hpp:638
DualQuat(const struct aa_tf_vec3 &v)
Construct from an identity rotation and a translation vector.
Definition: spatial.hpp:713
DualQuat(const struct aa_tf_duqu &S)
Construct from another dual quaternion.
Definition: spatial.hpp:643
DualQuat(const ZAngle &r, const struct aa_tf_vec3 &v)
Construct from a rotation about Z and a translation vector.
Definition: spatial.hpp:705
static aa_tf_duqu from_dx(double *s, double *dx)
Create a dual quaternion derivative from a dual quaternion and the spatial velocity.
Definition: spatial.hpp:834
static aa_tf_duqu from_duqu(const double s[8])
Create a dual quaternion from another dual quaternion.
Definition: spatial.hpp:761
DualQuat(const struct aa_tf_quat &r, const struct aa_tf_vec3 &v)
Construct from a quaternion-vector.
Definition: spatial.hpp:671
static aa_tf_duqu from_tfmat(const double T[12])
Create a dual quaternion from a transformation matrix.
Definition: spatial.hpp:782
DualQuat(const struct aa_tf_qv *S)
Construct from a quaternion-vector.
Definition: spatial.hpp:648
static aa_tf_duqu from_xyz(double x, double y, double z)
Create a dual quaternion from and identity rotation and translation components.
Definition: spatial.hpp:823
DualQuat()
Construct an identity dual quaternion.
Definition: spatial.hpp:628
static aa_tf_duqu from_xyzw(double x_real, double y_real, double z_real, double w_real, double x_dual, double y_dual, double z_dual, double w_dual)
Create a dual quaternion from components.
Definition: spatial.hpp:748
DualQuat(const double *S)
Construct from another dual quaternion.
Definition: spatial.hpp:633
aa_tf_vec3 translation()
Return the translation part of a unit dual quaternion.
Definition: spatial.hpp:738
static aa_tf_duqu from_xxyz(double theta, double x, double y, double z)
Create a dual quaternion an X axis rotation and translation components.
Definition: spatial.hpp:792
DualQuat(const YAngle &r, const struct aa_tf_vec3 &v)
Construct from a rotation about Y and a translation vector.
Definition: spatial.hpp:697
static aa_tf_duqu from_zxyz(double theta, double x, double y, double z)
Create a dual quaternion an Z axis rotation and translation components.
Definition: spatial.hpp:812
DualQuat(const XAngle &r, const struct aa_tf_vec3 &v)
Construct from a rotation about X and a translation vector.
Definition: spatial.hpp:689
DualQuat(const struct aa_tf_qv &S)
Construct from a quaternion-vector.
Definition: spatial.hpp:656
DualQuat conj()
Return the conjugate of this.
Definition: spatial.hpp:728
DualQuat(const struct aa_tf_quat *r, const struct aa_tf_vec3 *v)
Construct from a quaternion-vector.
Definition: spatial.hpp:663
DualQuat(const aa_tf_axang &r, const struct aa_tf_vec3 &v)
Construct from an axis-angle rotation and a translation vector.
Definition: spatial.hpp:720
A rotation quaternion and translation vector object.
Definition: spatial.hpp:845
QuatTran(const struct aa_tf_duqu *S)
Construct from a dual quaternion.
Definition: spatial.hpp:908
QuatTran(const struct YAngle &_r, const struct aa_tf_vec3 &_v)
Construct from a principal angle and a vector.
Definition: spatial.hpp:892
QuatTran(const struct aa_tf_quat &_r, const struct aa_tf_vec3 &_v)
Construct from another quaternion-translation.
Definition: spatial.hpp:876
static aa_tf_qv from_duqu(const double s[8])
Create a quaternion-translation from a dual quaternion.
Definition: spatial.hpp:968
void transform(const aa_tf_vec3 *a, aa_tf_vec3 *b) const
Transform a vector.
Definition: spatial.hpp:996
static aa_tf_qv from_tfmat(const double t[12])
Create a quaternion-translation from a transformation matrix.
Definition: spatial.hpp:978
void transform(const double a[3], double b[3]) const
Transform a vector.
Definition: spatial.hpp:988
static aa_tf_qv from_qv(const double e[7])
Create a quaternion-translation from a rotation quaternion and a translation vector.
Definition: spatial.hpp:963
QuatTran(const struct XAngle &_r, const struct aa_tf_vec3 &_v)
Construct from a principal angle and a vector.
Definition: spatial.hpp:884
static aa_tf_qv from_xyzw(double q_x, double q_y, double q_z, double q_w, double t_x, double t_y, double t_z)
Create a quaternion-translation from components.
Definition: spatial.hpp:938
QuatTran(const struct aa_tf_tfmat &T)
Construct from a transformation matrix.
Definition: spatial.hpp:923
QuatTran(const struct aa_tf_qv &S)
Construct from another quaternion-translation.
Definition: spatial.hpp:861
static aa_tf_qv from_qv(const double a_r[4], const double a_v[3])
Create a quaternion-translation from a rotation quaternion and a translation vector.
Definition: spatial.hpp:951
QuatTran(const struct aa_tf_qv *S)
Construct from another quaternion-translation.
Definition: spatial.hpp:854
aa_tf_qv conj()
Return the conjugate (inverse).
Definition: spatial.hpp:928
QuatTran(const struct ZAngle &_r, const struct aa_tf_vec3 &_v)
Construct from a principal angle and a vector.
Definition: spatial.hpp:900
aa_tf_vec3 transform(const aa_tf_vec3 &a) const
Transform a vector.
Definition: spatial.hpp:1004
QuatTran()
Construct an idenity object.
Definition: spatial.hpp:849
QuatTran(const struct aa_tf_duqu &S)
Construct from a dual quaternion.
Definition: spatial.hpp:913
QuatTran(const struct aa_tf_quat *_r, const struct aa_tf_vec3 *_v)
Construct from another quaternion-translation.
Definition: spatial.hpp:868
QuatTran(const struct aa_tf_tfmat *T)
Construct from a transformation matrix.
Definition: spatial.hpp:918
A quaternion object.
Definition: spatial.hpp:180
Quat(const aa_tf_rotmat *p)
Construct from a rotation matrix.
Definition: spatial.hpp:199
static aa_tf_quat from_zangle(const double v)
Create a quaternion object rotation about z.
Definition: spatial.hpp:334
static aa_tf_quat from_rotmat(const double x[9])
Create a quaternion object a rotation matrix.
Definition: spatial.hpp:275
Quat(const XAngle &p)
Construct from a rotation about the x axis.
Definition: spatial.hpp:219
static aa_tf_quat from_quat(const double x[4])
Create a quaternion object from a quaternion array.
Definition: spatial.hpp:252
Quat(const aa_tf_quat *p)
Construct from another quaternion.
Definition: spatial.hpp:189
Quat(const aa_tf_axang *p)
Construct from an axix angle rotation.
Definition: spatial.hpp:209
Quat(const YAngle &p)
Construct from a rotation about the Y axis.
Definition: spatial.hpp:224
Quat(const aa_tf_axang &p)
Construct from an axix angle rotation.
Definition: spatial.hpp:214
Quat(const aa_tf_rotmat &p)
Construct from a rotation matrix.
Definition: spatial.hpp:204
aa_tf_vec3 rotate(const aa_tf_vec3 &p) const
Rotate a vector by this quaternion.
Definition: spatial.hpp:242
Quat()
Construct an identity quaternion.
Definition: spatial.hpp:184
static aa_tf_quat from_rotvec(const double x[3])
Create a quaternion object a rotation vector.
Definition: spatial.hpp:304
Quat(const aa_tf_quat &p)
Construct from another quaternion.
Definition: spatial.hpp:194
static aa_tf_quat from_axang(const double x[4])
Create a quaternion object an axis-angle.
Definition: spatial.hpp:285
Quat(const ZAngle &p)
Construct from a rotation about the Z axis.
Definition: spatial.hpp:229
static aa_tf_quat from_xangle(const double v)
Create a quaternion object rotation about x.
Definition: spatial.hpp:314
static aa_tf_quat from_axang(const double a[3], double angle)
Create a quaternion object an axis-angle.
Definition: spatial.hpp:295
static aa_tf_quat from_yangle(const double v)
Create a quaternion object rotation about y.
Definition: spatial.hpp:324
static aa_tf_quat from_xyzw(double x, double y, double z, double w)
Create a quaternion object from components.
Definition: spatial.hpp:262
void rotate(const aa_tf_vec3 *p, aa_tf_vec3 *q) const
Rotate a vector by this quaternion.
Definition: spatial.hpp:234
A rotation matrix object.
Definition: spatial.hpp:345
RotMat(const aa_tf_axang *p)
Construct a rotation matrix from an axis-angle.
Definition: spatial.hpp:374
RotMat()
Construct an identity rotation matrix.
Definition: spatial.hpp:349
static aa_tf_rotmat from_quat(const double x[4])
Create a rotation matrix from a unit quaternion.
Definition: spatial.hpp:430
RotMat(const XAngle &p)
Construct a rotation matrix from a rotation about X.
Definition: spatial.hpp:384
static aa_tf_rotmat from_rotvec(const double x[3])
Create a rotation matrix from a rotation vector.
Definition: spatial.hpp:460
RotMat(const aa_tf_rotmat *p)
Construct a rotation matrix from another rotation matrix.
Definition: spatial.hpp:364
static aa_tf_rotmat from_axang(const double x[4])
Create a rotation matrix from an axis-angle.
Definition: spatial.hpp:450
static aa_tf_rotmat from_xangle(const double v)
Create a rotation matrix from a rotation about X.
Definition: spatial.hpp:470
RotMat(const aa_tf_rotmat &p)
Construct a rotation matrix from another rotation matrix.
Definition: spatial.hpp:369
RotMat(const YAngle &p)
Construct a rotation matrix from a rotation about Y.
Definition: spatial.hpp:389
static aa_tf_rotmat from_zangle(const double v)
Create a rotation matrix from a rotation about Z.
Definition: spatial.hpp:490
RotMat(const aa_tf_quat &p)
Construct a rotation matrix from a unit quaternion.
Definition: spatial.hpp:359
static aa_tf_rotmat from_rotmat(double r11, double r12, double r13, double r21, double r22, double r23, double r31, double r32, double r33)
Create a rotation matrix from individual components.
Definition: spatial.hpp:408
static aa_tf_rotmat from_rotmat(const double x[9])
Create a rotation matrix object from a rotation matrix array.
Definition: spatial.hpp:440
RotMat(const ZAngle &p)
Construct a rotation matrix from a rotation about Z.
Definition: spatial.hpp:394
RotMat(double r11, double r12, double r13, double r21, double r22, double r23, double r31, double r32, double r33)
Construct a rotation matrix from individual components.
Definition: spatial.hpp:399
RotMat(const aa_tf_axang &p)
Construct a rotation matrix from an axis-angle.
Definition: spatial.hpp:379
static aa_tf_rotmat from_yangle(const double v)
Create a rotation matrix from a rotation about Y.
Definition: spatial.hpp:480
RotMat(const aa_tf_quat *p)
Construct a rotation matrix from a unit quaternion.
Definition: spatial.hpp:354
A transformation matrix object.
Definition: spatial.hpp:1015
aa_tf_vec3 transform(const aa_tf_vec3 &a) const
Transform a vector.
Definition: spatial.hpp:1121
void transform(const aa_tf_vec3 *a, aa_tf_vec3 *b) const
Transform a vector.
Definition: spatial.hpp:1113
static aa_tf_tfmat from_tfmat(const double t[12])
Construct a transformation matrix from another transformation matrix.
Definition: spatial.hpp:1095
static aa_tf_tfmat from_qv(const double q[4], const double v[3])
Construct a transformation matrix from a rotation quaternion and translation vector.
Definition: spatial.hpp:1085
TfMat(const struct aa_tf_duqu *S)
Construct a transformation matrix from a dual quaternion.
Definition: spatial.hpp:1034
static aa_tf_tfmat from_duqu(const double s[8])
Construct a transformation matrix from a dual quaternion.
Definition: spatial.hpp:1074
TfMat(const struct aa_tf_qv *S)
Construct a transformation matrix from a quaternion-translation.
Definition: spatial.hpp:1044
TfMat(const struct aa_tf_quat *_r, const struct aa_tf_vec3 *_v)
Construct a transformation matrix from a quaternion-translation.
Definition: spatial.hpp:1058
TfMat(const struct aa_tf_qv &S)
Construct a transformation matrix from a quaternion-translation.
Definition: spatial.hpp:1051
void transform(const double a[3], double b[3]) const
Transform a vector.
Definition: spatial.hpp:1105
TfMat(const struct aa_tf_tfmat *T)
Construct a transformation matrix from another transformation matrix.
Definition: spatial.hpp:1024
TfMat()
Construct an identity transformation matrix.
Definition: spatial.hpp:1019
TfMat(const struct aa_tf_duqu &S)
Construct a transformation matrix from a dual quaternion.
Definition: spatial.hpp:1039
TfMat(const struct aa_tf_tfmat &T)
Construct a transformation matrix from another transformation matrix.
Definition: spatial.hpp:1029
TfMat(const struct aa_tf_quat &_r, const struct aa_tf_vec3 &_v)
Construct a transformation matrix from a quaternion-translation.
Definition: spatial.hpp:1066
A vector of length 3.
Definition: spatial.hpp:64
Vec3(const double *_xyz)
Construct from array.
Definition: spatial.hpp:95
Vec3(const struct aa_tf_duqu *S)
Extract the translation part of a unit dual quaternion.
Definition: spatial.hpp:70
Vec3(const struct aa_tf_tfmat &T)
Extract the translation part of a transformation matrix.
Definition: spatial.hpp:85
Vec3(const struct aa_tf_tfmat *T)
Extract the translation part of a transformation matrix.
Definition: spatial.hpp:80
Vec3(const struct aa_tf_duqu &S)
Extract the translation part of a unit dual quaternion.
Definition: spatial.hpp:75
Vec3(double _x, double _y, double _z)
Construct from individual components.
Definition: spatial.hpp:90
static aa_tf_vec3 from_tfmat(const double T[12])
Create a Vec3 from translation part of transformation matrix.
Definition: spatial.hpp:137
static aa_tf_vec3 from_duqu(const double S[8])
Create a Vec3 from translation part of unit dual quation.
Definition: spatial.hpp:127
static aa_tf_vec3 from_vec3(const double a_x[3])
Create a Vec3 from array.
Definition: spatial.hpp:117
Vec3(const aa_tf_vec3 &src)
Construct from vec3.
Definition: spatial.hpp:100
static aa_tf_vec3 from_xyz(double x, double y, double z)
Create a Vec3 from components.
Definition: spatial.hpp:105
A rotation about the X axis.
Definition: spatial.hpp:150
XAngle(double v)
Construct with the given angle.
Definition: spatial.hpp:154
double value
The angle value in radians.
Definition: spatial.hpp:151
A rotation about the Y axis.
Definition: spatial.hpp:160
double value
The angle value in radians.
Definition: spatial.hpp:161
YAngle(double v)
Construct with the given angle.
Definition: spatial.hpp:164
A rotation about the Z axis.
Definition: spatial.hpp:170
double value
The angle value in radians.
Definition: spatial.hpp:171
ZAngle(double v)
Construct with the given angle.
Definition: spatial.hpp:174