121 cMatrix3d(
const Eigen::Matrix3d& a_matrix)
123 (*this)(0,0) = a_matrix(0,0);
124 (*this)(0,1) = a_matrix(0,1);
125 (*this)(0,2) = a_matrix(0,2);
126 (*this)(1,0) = a_matrix(1,0);
127 (*this)(1,1) = a_matrix(1,1);
128 (*this)(1,2) = a_matrix(1,2);
129 (*this)(2,0) = a_matrix(2,0);
130 (*this)(2,1) = a_matrix(2,1);
131 (*this)(2,2) = a_matrix(2,2);
151 cMatrix3d(
const double& a_m00,
const double& a_m01,
const double& a_m02,
152 const double& a_m10,
const double& a_m11,
const double& a_m12,
153 const double& a_m20,
const double& a_m21,
const double& a_m22)
155 (*this)(0,0) = a_m00; (*this)(0,1) = a_m01; (*this)(0,2) = a_m02;
156 (*this)(1,0) = a_m10; (*this)(1,1) = a_m11; (*this)(1,2) = a_m12;
157 (*this)(2,0) = a_m20; (*this)(2,1) = a_m21; (*this)(2,2) = a_m22;
175 (*this).setCol0(a_colVector0);
176 (*this).setCol1(a_colVector1);
177 (*this).setCol2(a_colVector2);
192 cMatrix3d(
const Eigen::Vector3d& a_colVector0,
193 const Eigen::Vector3d& a_colVector1,
194 const Eigen::Vector3d& a_colVector2)
196 (*this)(0,0) = a_colVector0(0); (*this)(0,1) = a_colVector1(0); (*this)(0,2) = a_colVector2(0);
197 (*this)(1,0) = a_colVector0(1); (*this)(1,1) = a_colVector1(1); (*this)(1,2) = a_colVector2(1);
198 (*this)(2,0) = a_colVector0(2); (*this)(2,1) = a_colVector1(2); (*this)(2,2) = a_colVector2(2);
223 const double& a_angle2,
224 const double& a_angle3,
226 const bool a_useIntrinsicEulerModel =
true,
227 const bool a_anglesDefinedInDegrees =
false)
229 if (a_anglesDefinedInDegrees)
231 if (a_useIntrinsicEulerModel)
242 if (a_useIntrinsicEulerModel)
265 const double& a_angleRad)
283 const double& a_axisY,
284 const double& a_axisZ,
285 const double& a_angleRad)
297 Eigen::Matrix3d eigen()
300 m(0,0) = (*this)(0,0);
301 m(0,1) = (*this)(0,1);
302 m(0,2) = (*this)(0,2);
303 m(1,0) = (*this)(1,0);
304 m(1,1) = (*this)(1,1);
305 m(1,2) = (*this)(1,2);
306 m(2,0) = (*this)(2,0);
307 m(2,1) = (*this)(2,1);
308 m(2,2) = (*this)(2,2);
327 (*this)(0,0) = 1.0; (*this)(0,1) = 0.0; (*this)(0,2) = 0.0;
328 (*this)(1,0) = 0.0; (*this)(1,1) = 1.0; (*this)(1,2) = 0.0;
329 (*this)(2,0) = 0.0; (*this)(2,1) = 0.0; (*this)(2,2) = 1.0;
345 inline void set(
const double& a_value)
347 (*this)(0,0) = a_value; (*this)(0,1) = a_value; (*this)(0,2) = a_value;
348 (*this)(1,0) = a_value; (*this)(1,1) = a_value; (*this)(1,2) = a_value;
349 (*this)(2,0) = a_value; (*this)(2,1) = a_value; (*this)(2,2) = a_value;
365 inline void set(
const double a_source[3][3])
367 (*this)(0,0) = a_source[0][0];
368 (*this)(0,1) = a_source[0][1];
369 (*this)(0,2) = a_source[0][2];
370 (*this)(1,0) = a_source[1][0];
371 (*this)(1,1) = a_source[1][1];
372 (*this)(1,2) = a_source[1][2];
373 (*this)(2,0) = a_source[2][0];
374 (*this)(2,1) = a_source[2][1];
375 (*this)(2,2) = a_source[2][2];
400 inline void set(
const double& a_m00,
const double& a_m01,
const double& a_m02,
401 const double& a_m10,
const double& a_m11,
const double& a_m12,
402 const double& a_m20,
const double& a_m21,
const double& a_m22)
404 (*this)(0,0) = a_m00; (*this)(0,1) = a_m01; (*this)(0,2) = a_m02;
405 (*this)(1,0) = a_m10; (*this)(1,1) = a_m11; (*this)(1,2) = a_m12;
406 (*this)(2,0) = a_m20; (*this)(2,1) = a_m21; (*this)(2,2) = a_m22;
433 (*this)(0,0) = a_vectCol0(0); (*this)(0,1) = a_vectCol1(0); (*this)(0,2) = a_vectCol2(0);
434 (*this)(1,0) = a_vectCol0(1); (*this)(1,1) = a_vectCol1(1); (*this)(1,2) = a_vectCol2(1);
435 (*this)(2,0) = a_vectCol0(2); (*this)(2,1) = a_vectCol1(2); (*this)(2,2) = a_vectCol2(2);
453 (*this)(0,0) = a_vectCol(0);
454 (*this)(1,0) = a_vectCol(1);
455 (*this)(2,0) = a_vectCol(2);
473 (*this)(0,1) = a_vectCol(0);
474 (*this)(1,1) = a_vectCol(1);
475 (*this)(2,1) = a_vectCol(2);
493 (*this)(0,2) = a_vectCol(0);
494 (*this)(1,2) = a_vectCol(1);
495 (*this)(2,2) = a_vectCol(2);
511 inline void get(
double* a_destination[])
513 *a_destination[0] = (*this)(0,0);
514 *a_destination[1] = (*this)(0,1);
515 *a_destination[2] = (*this)(0,2);
516 *a_destination[3] = (*this)(1,0);
517 *a_destination[4] = (*this)(1,1);
518 *a_destination[5] = (*this)(1,2);
519 *a_destination[6] = (*this)(2,0);
520 *a_destination[7] = (*this)(2,1);
521 *a_destination[8] = (*this)(2,2);
539 result(0) = (*this)(0,0);
540 result(1) = (*this)(1,0);
541 result(2) = (*this)(2,0);
560 result(0) = (*this)(0,1);
561 result(1) = (*this)(1,1);
562 result(2) = (*this)(2,1);
581 result(0) = (*this)(0,2);
582 result(1) = (*this)(1,2);
583 result(2) = (*this)(2,2);
605 result(0) = (*this)(a_index, 0);
606 result(1) = (*this)(a_index, 1);
607 result(2) = (*this)(a_index, 2);
630 a_destination = (*this);
651 inline void copyto(Eigen::Matrix3d& a_destination)
const
653 a_destination(0,0) = (*this)(0,0); a_destination(0,1) = (*this)(0,1); a_destination(0,2) = (*this)(0,2);
654 a_destination(1,0) = (*this)(1,0); a_destination(1,1) = (*this)(1,1); a_destination(1,2) = (*this)(1,2);
655 a_destination(2,0) = (*this)(2,0); a_destination(2,1) = (*this)(2,1); a_destination(2,2) = (*this)(2,2);
698 inline void copyfrom(
const Eigen::Matrix3d& a_source)
700 (*this)(0,0) = a_source(0,0); (*this)(0,1) = a_source(0,1); (*this)(0,2) = a_source(0,2);
701 (*this)(1,0) = a_source(1,0); (*this)(1,1) = a_source(1,1); (*this)(1,2) = a_source(1,2);
702 (*this)(2,0) = a_source(2,0); (*this)(2,1) = a_source(2,1); (*this)(2,2) = a_source(2,2);
724 for(
int i=0; i<3; i++)
726 for(
int j=0; j<3; j++)
728 if (a_matrix(i,j) != (*
this)(i,j))
return (
false);
754 (*this)(0,0) = (*
this)(0,0) + a_matrix(0,0);
755 (*this)(0,1) = (*
this)(0,1) + a_matrix(0,1);
756 (*this)(0,2) = (*
this)(0,2) + a_matrix(0,2);
757 (*this)(1,0) = (*
this)(1,0) + a_matrix(1,0);
758 (*this)(1,1) = (*
this)(1,1) + a_matrix(1,1);
759 (*this)(1,2) = (*
this)(1,2) + a_matrix(1,2);
760 (*this)(2,0) = (*
this)(2,0) + a_matrix(2,0);
761 (*this)(2,1) = (*
this)(2,1) + a_matrix(2,1);
762 (*this)(2,2) = (*
this)(2,2) + a_matrix(2,2);
788 a_result(0,0) = (*this)(0,0) + a_matrix(0,0);
789 a_result(0,1) = (*this)(0,1) + a_matrix(0,1);
790 a_result(0,2) = (*this)(0,2) + a_matrix(0,2);
791 a_result(1,0) = (*this)(1,0) + a_matrix(1,0);
792 a_result(1,1) = (*this)(1,1) + a_matrix(1,1);
793 a_result(1,2) = (*this)(1,2) + a_matrix(1,2);
794 a_result(2,0) = (*this)(2,0) + a_matrix(2,0);
795 a_result(2,1) = (*this)(2,1) + a_matrix(2,1);
796 a_result(2,2) = (*this)(2,2) + a_matrix(2,2);
819 (*this)(0,0) = (*
this)(0,0) - a_matrix(0,0);
820 (*this)(0,1) = (*
this)(0,1) - a_matrix(0,1);
821 (*this)(0,2) = (*
this)(0,2) - a_matrix(0,2);
822 (*this)(1,0) = (*
this)(1,0) - a_matrix(1,0);
823 (*this)(1,1) = (*
this)(1,1) - a_matrix(1,1);
824 (*this)(1,2) = (*
this)(1,2) - a_matrix(1,2);
825 (*this)(2,0) = (*
this)(2,0) - a_matrix(2,0);
826 (*this)(2,1) = (*
this)(2,1) - a_matrix(2,1);
827 (*this)(2,2) = (*
this)(2,2) - a_matrix(2,2);
853 a_result(0,0) = (*this)(0,0) - a_matrix(0,0);
854 a_result(0,1) = (*this)(0,1) - a_matrix(0,1);
855 a_result(0,2) = (*this)(0,2) - a_matrix(0,2);
856 a_result(1,0) = (*this)(1,0) - a_matrix(1,0);
857 a_result(1,1) = (*this)(1,1) - a_matrix(1,1);
858 a_result(1,2) = (*this)(1,2) - a_matrix(1,2);
859 a_result(2,0) = (*this)(2,0) - a_matrix(2,0);
860 a_result(2,1) = (*this)(2,1) - a_matrix(2,1);
861 a_result(2,2) = (*this)(2,2) - a_matrix(2,2);
882 inline void mul(
const double& a_scalar)
885 (*this)(0, 0) = (*
this)(0, 0) * a_scalar;
886 (*this)(0, 1) = (*
this)(0, 1) * a_scalar;
887 (*this)(0, 2) = (*
this)(0, 2) * a_scalar;
888 (*this)(1, 0) = (*
this)(1, 0) * a_scalar;
889 (*this)(1, 1) = (*
this)(1, 1) * a_scalar;
890 (*this)(1, 2) = (*
this)(1, 2) * a_scalar;
891 (*this)(2, 0) = (*
this)(2, 0) * a_scalar;
892 (*this)(2, 1) = (*
this)(2, 1) * a_scalar;
893 (*this)(2, 2) = (*
this)(2, 2) * a_scalar;
916 inline void mulr(
const double& a_scalar,
920 a_result(0, 0) = (*this)(0, 0) * a_scalar;
921 a_result(0, 1) = (*this)(0, 1) * a_scalar;
922 a_result(0, 2) = (*this)(0, 2) * a_scalar;
923 a_result(1, 0) = (*this)(1, 0) * a_scalar;
924 a_result(1, 1) = (*this)(1, 1) * a_scalar;
925 a_result(1, 2) = (*this)(1, 2) * a_scalar;
926 a_result(2, 0) = (*this)(2, 0) * a_scalar;
927 a_result(2, 1) = (*this)(2, 1) * a_scalar;
928 a_result(2, 2) = (*this)(2, 2) * a_scalar;
953 double m00 = (*this)(0,0) * a_matrix(0,0) + (*this)(0,1) * a_matrix(1,0) + (*this)(0,2) * a_matrix(2,0);
954 double m01 = (*this)(0,0) * a_matrix(0,1) + (*this)(0,1) * a_matrix(1,1) + (*this)(0,2) * a_matrix(2,1);
955 double m02 = (*this)(0,0) * a_matrix(0,2) + (*this)(0,1) * a_matrix(1,2) + (*this)(0,2) * a_matrix(2,2);
956 double m10 = (*this)(1,0) * a_matrix(0,0) + (*this)(1,1) * a_matrix(1,0) + (*this)(1,2) * a_matrix(2,0);
957 double m11 = (*this)(1,0) * a_matrix(0,1) + (*this)(1,1) * a_matrix(1,1) + (*this)(1,2) * a_matrix(2,1);
958 double m12 = (*this)(1,0) * a_matrix(0,2) + (*this)(1,1) * a_matrix(1,2) + (*this)(1,2) * a_matrix(2,2);
959 double m20 = (*this)(2,0) * a_matrix(0,0) + (*this)(2,1) * a_matrix(1,0) + (*this)(2,2) * a_matrix(2,0);
960 double m21 = (*this)(2,0) * a_matrix(0,1) + (*this)(2,1) * a_matrix(1,1) + (*this)(2,2) * a_matrix(2,1);
961 double m22 = (*this)(2,0) * a_matrix(0,2) + (*this)(2,1) * a_matrix(1,2) + (*this)(2,2) * a_matrix(2,2);
964 (*this)(0,0) = m00; (*this)(0,1) = m01; (*this)(0,2) = m02;
965 (*this)(1,0) = m10; (*this)(1,1) = m11; (*this)(1,2) = m12;
966 (*this)(2,0) = m20; (*this)(2,1) = m21; (*this)(2,2) = m22;
993 a_result(0,0) = (*this)(0,0) * a_matrix(0,0) + (*this)(0,1) * a_matrix(1,0) + (*this)(0,2) * a_matrix(2,0);
994 a_result(0,1) = (*this)(0,0) * a_matrix(0,1) + (*this)(0,1) * a_matrix(1,1) + (*this)(0,2) * a_matrix(2,1);
995 a_result(0,2) = (*this)(0,0) * a_matrix(0,2) + (*this)(0,1) * a_matrix(1,2) + (*this)(0,2) * a_matrix(2,2);
996 a_result(1,0) = (*this)(1,0) * a_matrix(0,0) + (*this)(1,1) * a_matrix(1,0) + (*this)(1,2) * a_matrix(2,0);
997 a_result(1,1) = (*this)(1,0) * a_matrix(0,1) + (*this)(1,1) * a_matrix(1,1) + (*this)(1,2) * a_matrix(2,1);
998 a_result(1,2) = (*this)(1,0) * a_matrix(0,2) + (*this)(1,1) * a_matrix(1,2) + (*this)(1,2) * a_matrix(2,2);
999 a_result(2,0) = (*this)(2,0) * a_matrix(0,0) + (*this)(2,1) * a_matrix(1,0) + (*this)(2,2) * a_matrix(2,0);
1000 a_result(2,1) = (*this)(2,0) * a_matrix(0,1) + (*this)(2,1) * a_matrix(1,1) + (*this)(2,2) * a_matrix(2,1);
1001 a_result(2,2) = (*this)(2,0) * a_matrix(0,2) + (*this)(2,1) * a_matrix(1,2) + (*this)(2,2) * a_matrix(2,2);
1026 double x = (*this)(0,0) * a_vector(0) + (*this)(0,1) * a_vector(1) + (*this)(0,2) * a_vector(2);
1027 double y = (*this)(1,0) * a_vector(0) + (*this)(1,1) * a_vector(1) + (*this)(1,2) * a_vector(2);
1028 double z = (*this)(2,0) * a_vector(0) + (*this)(2,1) * a_vector(1) + (*this)(2,2) * a_vector(2);
1055 a_result(0) = (*this)(0,0) * a_vector(0) + (*this)(0,1) * a_vector(1) + (*this)(0,2) * a_vector(2);
1056 a_result(1) = (*this)(1,0) * a_vector(0) + (*this)(1,1) * a_vector(1) + (*this)(1,2) * a_vector(2);
1057 a_result(2) = (*this)(2,0) * a_vector(0) + (*this)(2,1) * a_vector(1) + (*this)(2,2) * a_vector(2);
1074 return (+ (*
this)(0,0) * (*
this)(1,1) * (*
this)(2,2)
1075 + (*
this)(0,1) * (*
this)(1,2) * (*
this)(2,0)
1076 + (*
this)(0,2) * (*
this)(1,0) * (*
this)(2,1)
1077 - (*
this)(2,0) * (*
this)(1,1) * (*
this)(0,2)
1078 - (*
this)(2,1) * (*
this)(1,2) * (*
this)(0,0)
1079 - (*
this)(2,2) * (*
this)(1,0) * (*
this)(0,1));
1097 t = (*this)(0,1); (*this)(0,1) = (*
this)(1,0); (*this)(1,0) = t;
1098 t = (*this)(0,2); (*this)(0,2) = (*
this)(2,0); (*this)(2,0) = t;
1099 t = (*this)(1,2); (*this)(1,2) = (*
this)(2,1); (*this)(2,1) = t;
1118 a_result(0,0) = (*this)(0,0);
1119 a_result(0,1) = (*this)(1,0);
1120 a_result(0,2) = (*this)(2,0);
1122 a_result(1,0) = (*this)(0,1);
1123 a_result(1,1) = (*this)(1,1);
1124 a_result(1,2) = (*this)(2,1);
1126 a_result(2,0) = (*this)(0,2);
1127 a_result(2,1) = (*this)(1,2);
1128 a_result(2,2) = (*this)(2,2);
1147 double d = ( + (*this)(0,0) * (*
this)(1,1) * (*
this)(2,2)
1148 + (*
this)(0,1) * (*
this)(1,2) * (*
this)(2,0)
1149 + (*
this)(0,2) * (*
this)(1,0) * (*
this)(2,1)
1150 - (*
this)(2,0) * (*
this)(1,1) * (*
this)(0,2)
1151 - (*
this)(2,1) * (*
this)(1,2) * (*
this)(0,0)
1152 - (*
this)(2,2) * (*
this)(1,0) * (*
this)(0,1));
1163 double m00 = ((*this)(1,1) * (*
this)(2,2) - (*
this)(2,1)*(*
this)(1,2)) / d;
1164 double m01 = -((*this)(0,1) * (*
this)(2,2) - (*
this)(2,1)*(*
this)(0,2)) / d;
1165 double m02 = ((*this)(0,1) * (*
this)(1,2) - (*
this)(1,1)*(*
this)(0,2)) / d;
1167 double m10 = -((*this)(1,0) * (*
this)(2,2) - (*
this)(2,0)*(*
this)(1,2)) / d;
1168 double m11 = ((*this)(0,0) * (*
this)(2,2) - (*
this)(2,0)*(*
this)(0,2)) / d;
1169 double m12 = -((*this)(0,0) * (*
this)(1,2) - (*
this)(1,0)*(*
this)(0,2)) / d;
1171 double m20 = ((*this)(1,0) * (*
this)(2,1) - (*
this)(2,0)*(*
this)(1,1)) / d;
1172 double m21 = -((*this)(0,0) * (*
this)(2,1) - (*
this)(2,0)*(*
this)(0,1)) / d;
1173 double m22 = ((*this)(0,0) * (*
this)(1,1) - (*
this)(1,0)*(*
this)(0,1)) / d;
1176 (*this)(0,0) = m00; (*this)(0,1) = m01; (*this)(0,2) = m02;
1177 (*this)(1,0) = m10; (*this)(1,1) = m11; (*this)(1,2) = m12;
1178 (*this)(2,0) = m20; (*this)(2,1) = m21; (*this)(2,2) = m22;
1202 double d = ( + (*this)(0,0) * (*
this)(1,1) * (*
this)(2,2)
1203 + (*
this)(0,1) * (*
this)(1,2) * (*
this)(2,0)
1204 + (*
this)(0,2) * (*
this)(1,0) * (*
this)(2,1)
1205 - (*
this)(2,0) * (*
this)(1,1) * (*
this)(0,2)
1206 - (*
this)(2,1) * (*
this)(1,2) * (*
this)(0,0)
1207 - (*
this)(2,2) * (*
this)(1,0) * (*
this)(0,1));
1218 a_result(0,0) = ((*this)(1,1) * (*
this)(2,2) - (*
this)(2,1)*(*
this)(1,2)) / d;
1219 a_result(0,1) = -((*this)(0,1) * (*
this)(2,2) - (*
this)(2,1)*(*
this)(0,2)) / d;
1220 a_result(0,2) = ((*this)(0,1) * (*
this)(1,2) - (*
this)(1,1)*(*
this)(0,2)) / d;
1222 a_result(1,0) = -((*this)(1,0) * (*
this)(2,2) - (*
this)(2,0)*(*
this)(1,2)) / d;
1223 a_result(1,1) = ((*this)(0,0) * (*
this)(2,2) - (*
this)(2,0)*(*
this)(0,2)) / d;
1224 a_result(1,2) = -((*this)(0,0) * (*
this)(1,2) - (*
this)(1,0)*(*
this)(0,2)) / d;
1226 a_result(2,0) = ((*this)(1,0) * (*
this)(2,1) - (*
this)(2,0)*(*
this)(1,1)) / d;
1227 a_result(2,1) = -((*this)(0,0) * (*
this)(2,1) - (*
this)(2,0)*(*
this)(0,1)) / d;
1228 a_result(2,2) = ((*this)(0,0) * (*
this)(1,1) - (*
this)(1,0)*(*
this)(0,1)) / d;
1260 (*this)(0, 0) = c0(0); (*this)(0, 1) = c1(0); (*this)(0, 2) = c2(0);
1261 (*this)(1, 0) = c0(1); (*this)(1, 1) = c1(1); (*this)(1, 2) = c2(1);
1262 (*this)(2, 0) = c0(2); (*this)(2, 1) = c1(2); (*this)(2, 2) = c2(2);
1283 const double& a_angleRad)
1286 double length = a_axis.
length();
1296 double f = 1.0 / length;
1297 double x = f * a_axis(0);
1298 double y = f * a_axis(1);
1299 double z = f * a_axis(2);
1302 double c = ::cos(a_angleRad);
1303 double s = ::sin(a_angleRad);
1306 (*this)(0,0) = x*x*v+c; (*this)(0,1) = x*y*v-z*s; (*this)(0,2) = x*z*v+y*s;
1307 (*this)(1,0) = x*y*v+z*s; (*this)(1,1) = y*y*v+c; (*this)(1,2) = y*z*v-x*s;
1308 (*this)(2,0) = x*z*v-y*s; (*this)(2,1) = y*z*v+x*s; (*this)(2,2) = z*z*v+c;
1332 const double& a_angleDeg)
1357 const double& a_axisY,
1358 const double& a_axisZ,
1359 const double& a_angleRad)
1384 const double& a_axisY,
1385 const double& a_axisZ,
1386 const double& a_angleDeg)
1409 const double& a_angle2,
1410 const double& a_angle3,
1413 switch(a_eulerOrder)
1483 const double& a_angle2,
1484 const double& a_angle3,
1511 const double& a_angle2,
1512 const double& a_angle3,
1515 double c1 = ::cos(a_angle1);
1516 double s1 = ::sin(a_angle1);
1517 double c2 = ::cos(a_angle2);
1518 double s2 = ::sin(a_angle2);
1519 double c3 = ::cos(a_angle3);
1520 double s3 = ::sin(a_angle3);
1522 switch(a_eulerOrder)
1525 (*this)(0,0) = c2*c3; (*this)(0,1) =-c2*s3; (*this)(0,2) = s2;
1526 (*this)(1,0) = c1*s3+c3*s1*s2; (*this)(1,1) = c1*c3-s1*s2*s3; (*this)(1,2) =-c2*s1;
1527 (*this)(2,0) = s1*s3-c1*c3*s2; (*this)(2,1) = c3*s1+c1*s2*s3; (*this)(2,2) = c1*c2;
1531 (*this)(0,0) = c2; (*this)(0,1) = s2*s3; (*this)(0,2) = c3*s2;
1532 (*this)(1,0) = s1*s2; (*this)(1,1) = c1*c3-c2*s1*s3; (*this)(1,2) =-c1*s3-c2*c3*s1;
1533 (*this)(2,0) =-c1*s2; (*this)(2,1) = c3*s1+c1*c2*s3; (*this)(2,2) = c1*c2*c3-s1*s3;
1537 (*this)(0,0) = c2*c3; (*this)(0,1) =-s2; (*this)(0,2) = c2*s3;
1538 (*this)(1,0) = s1*s3+c1*c3*s2; (*this)(1,1) = c1*c2; (*this)(1,2) = c1*s2*s3-c3*s1;
1539 (*this)(2,0) = c3*s1*s2-c1*s3; (*this)(2,1) = c2*s1; (*this)(2,2) = c1*c3+s1*s2*s3;
1543 (*this)(0,0) = c2; (*this)(0,1) =-c3*s2; (*this)(0,2) = s2*s3;
1544 (*this)(1,0) = c1*s2; (*this)(1,1) = c1*c2*c3-s1*s3; (*this)(1,2) =-c3*s1-c1*c2*s3;
1545 (*this)(2,0) = s1*s2; (*this)(2,1) = c1*s3+c2*c3*s1; (*this)(2,2) = c1*c3-c2*s1*s3;
1549 (*this)(0,0) = c1*c2; (*this)(0,1) = s1*s3-c1*c3*s2; (*this)(0,2) = c3*s1+c1*s2*s3;
1550 (*this)(1,0) = s2; (*this)(1,1) = c2*c3; (*this)(1,2) =-c2*s3;
1551 (*this)(2,0) =-c2*s1; (*this)(2,1) = c1*s3+c3*s1*s2; (*this)(2,2) = c1*c3-s1*s2*s3;
1555 (*this)(0,0) = c1*c2*c3-s1*s3; (*this)(0,1) =-c1*s2; (*this)(0,2) = c3*s1+c1*c2*s3;
1556 (*this)(1,0) = c3*s2; (*this)(1,1) = c2; (*this)(1,2) = s2*s3;
1557 (*this)(2,0) =-c1*s3-c2*c3*s1; (*this)(2,1) = s1*s2; (*this)(2,2) = c1*c3-c2*s1*s3;
1561 (*this)(0,0) = c1*c3+s1*s2*s3; (*this)(0,1) = c3*s1*s2-c1*s3; (*this)(0,2) = c2*s1;
1562 (*this)(1,0) = c2*s3; (*this)(1,1) = c2*c3; (*this)(1,2) =-s2;
1563 (*this)(2, 0) = c1*s2*s3 - c3*s1; (*this)(2, 1) = s1*s3 + c1*c3*s2; (*this)(2, 2) = c1*c2;
1567 (*this)(0,0) = c1*c3-c2*s1*s3; (*this)(0,1) = s1*s2; (*this)(0,2) = c1*s3+c2*c3*s1;
1568 (*this)(1,0) = s2*s3; (*this)(1,1) = c2; (*this)(1,2) =-c3*s2;
1569 (*this)(2,0) =-c3*s1-c1*c2*s3; (*this)(2,1) = c1*s2; (*this)(2,2) = c1*c2*c3-s1*s3;
1573 (*this)(0,0) = c1*c3-s1*s2*s3; (*this)(0,1) =-c2*s1; (*this)(0,2) = c1*s3+c3*s1*s2;
1574 (*this)(1,0) = c3*s1+c1*s2*s3; (*this)(1,1) = c1*c2; (*this)(1,2) = s1*s3-c1*c3*s2;
1575 (*this)(2,0) =-c2*s3; (*this)(2,1) = s2; (*this)(2,2) = c2*c3;
1579 (*this)(0,0) = c1*c3-c2*s1*s3; (*this)(0,1) =-c1*s3-c2*c3*s1; (*this)(0,2) = s1*s2;
1580 (*this)(1,0) = c3*s1+c1*c2*s3; (*this)(1,1) = c1*c2*c3-s1*s3; (*this)(1,2) =-c1*s2;
1581 (*this)(2,0) = s2*s3; (*this)(2,1) = c3*s2; (*this)(2,2) = c2;
1585 (*this)(0,0) = c1*c2; (*this)(0,1) = c1*s2*s3-c3*s1; (*this)(0,2) = s1*s3+c1*c3*s2;
1586 (*this)(1,0) = c2*s1; (*this)(1,1) = c1*c3+s1*s2*s3; (*this)(1,2) = c3*s1*s2-c1*s3;
1587 (*this)(2,0) =-s2; (*this)(2,1) = c2*s3; (*this)(2,2) = c2*c3;
1591 (*this)(0,0) = c1*c2*c3-s1*s3; (*this)(0,1) =-c3*s1-c1*c2*s3; (*this)(0,2) = c1*s2;
1592 (*this)(1,0) = c1*s3+c2*c3*s1; (*this)(1,1) = c1*c3-c2*s1*s3; (*this)(1,2) = s1*s2;
1593 (*this)(2,0) =-c3*s2; (*this)(2,1) = s2*s3; (*this)(2,2) = c2;
1616 const double& a_angle2,
1617 const double& a_angle3,
1649 switch(a_eulerOrder)
1733 a_eulerAngles1(0) =
C_RAD2DEG * eulerAngles1(0);
1734 a_eulerAngles1(1) =
C_RAD2DEG * eulerAngles1(1);
1735 a_eulerAngles1(2) =
C_RAD2DEG * eulerAngles1(2);
1737 a_eulerAngles2(0) =
C_RAD2DEG * eulerAngles2(0);
1738 a_eulerAngles2(1) =
C_RAD2DEG * eulerAngles2(1);
1739 a_eulerAngles2(2) =
C_RAD2DEG * eulerAngles2(2);
1775 bool locked =
false;
1776 bool flagUseSin =
false;
1779 switch(a_eulerOrder)
1790 Rc1c2 = (*this)(2, 2);
1791 Rc2s1 = (*this)(1, 2);
1792 Rc2s3 = (*this)(0, 1);
1793 Rc2c3 = (*this)(0, 0);
1794 Rc1s2s3c3s1 = (*this)(2, 1);
1795 Rs1s3c1c3s2 = (*this)(2, 0);
1817 Rc1c2 = (*this)(1, 1);
1818 Rc2s1 = (*this)(2, 1);
1819 Rc2s3 = (*this)(0, 2);
1820 Rc2c3 = (*this)(0, 0);
1821 Rc1s2s3c3s1 = (*this)(1, 2);
1822 Rs1s3c1c3s2 = (*this)(1, 0);
1844 Rc1c2 = (*this)(0, 0);
1845 Rc2s1 = (*this)(2, 0);
1846 Rc2s3 = (*this)(1, 2);
1847 Rc2c3 = (*this)(1, 1);
1848 Rc1s2s3c3s1 = (*this)(0, 2);
1849 Rs1s3c1c3s2 = (*this)(0, 1);
1872 Rc1c2 = (*this)(2, 2);
1873 Rc2s1 = (*this)(0, 2);
1874 Rc2s3 = (*this)(1, 0);
1875 Rc2c3 = (*this)(1, 1);
1876 Rc1s2s3c3s1 = (*this)(2, 0);
1877 Rs1s3c1c3s2 = (*this)(2, 1);
1899 Rc1c2 = (*this)(1, 1);
1900 Rc2s1 = (*this)(0, 1);
1901 Rc2s3 = (*this)(2, 0);
1902 Rc2c3 = (*this)(2, 2);
1903 Rc1s2s3c3s1 = (*this)(1, 0);
1904 Rs1s3c1c3s2 = (*this)(1, 2);
1926 Rc1c2 = (*this)(0, 0);
1927 Rc2s1 = (*this)(1, 0);
1928 Rc2s3 = (*this)(2, 1);
1929 Rc2c3 = (*this)(2, 2);
1930 Rc1s2s3c3s1 = (*this)(0, 1);
1931 Rs1s3c1c3s2 = (*this)(0, 2);
1949 if ((Rs != 1.0) && (Rs != -1.0))
1951 a_eulerAngles1(1) = sign * asin(Rs);
1952 a_eulerAngles2(1) =
C_PI - a_eulerAngles1(1);
1954 double cosAng1 = cos(a_eulerAngles1(1));
1955 double cosAng2 = cos(a_eulerAngles2(1));
1957 a_eulerAngles1(0) = -sign * atan2(Rc2s1 / cosAng1, Rc1c2 / cosAng1);
1958 a_eulerAngles2(0) = -sign * atan2(Rc2s1 / cosAng2, Rc1c2 / cosAng2);
1959 a_eulerAngles1(2) = -sign * atan2(Rc2s3 / cosAng1, Rc2c3 / cosAng1);
1960 a_eulerAngles2(2) = -sign * atan2(Rc2s3 / cosAng2, Rc2c3 / cosAng2);
1965 a_eulerAngles1(0) = 0.0;
1966 a_eulerAngles2(0) = 0.0;
1972 double value = atan2(-Rc1s2s3c3s1,-Rs1s3c1c3s2);
1973 a_eulerAngles1(2) =-sign * (a_eulerAngles1(0) + value);
1974 a_eulerAngles2(2) =-sign * (a_eulerAngles2(0) + value);
1980 double value = atan2(Rc1s2s3c3s1, Rs1s3c1c3s2);
1981 a_eulerAngles1(2) =-sign * (a_eulerAngles1(0) + value);
1982 a_eulerAngles2(2) =-sign * (a_eulerAngles2(0) + value);
2020 a_eulerAngles1(0) =
C_RAD2DEG * eulerAngles1(0);
2021 a_eulerAngles1(1) =
C_RAD2DEG * eulerAngles1(1);
2022 a_eulerAngles1(2) =
C_RAD2DEG * eulerAngles1(2);
2024 a_eulerAngles2(0) =
C_RAD2DEG * eulerAngles2(0);
2025 a_eulerAngles2(1) =
C_RAD2DEG * eulerAngles2(1);
2026 a_eulerAngles2(2) =
C_RAD2DEG * eulerAngles2(2);
2049 const double& a_angleRad)
2052 double length = a_axis.
length();
2062 double f = 1.0 / length;
2063 double x = f * a_axis(0);
2064 double y = f * a_axis(1);
2065 double z = f * a_axis(2);
2068 double c = ::cos(a_angleRad);
2069 double s = ::sin(a_angleRad);
2073 m(0,0) = x*x*v+c; m(0,1) = x*y*v-z*s; m(0,2) = x*z*v+y*s;
2074 m(1,0) = x*y*v+z*s; m(1,1) = y*y*v+c; m(1,2) = y*z*v-x*s;
2075 m(2,0) = x*z*v-y*s; m(2,1) = y*z*v+x*s; m(2,2) = z*z*v+c;
2077 (*this) = m*(*this);
2101 const double& a_angleDeg)
2126 const double& a_axisY,
2127 const double& a_axisZ,
2128 const double& a_angleRad)
2153 const double& a_axisY,
2154 const double& a_axisZ,
2155 const double& a_angleDeg)
2178 const double& a_angleRad)
2181 double length = a_axis.
length();
2191 double f = 1.0 / length;
2192 double x = f * a_axis(0);
2193 double y = f * a_axis(1);
2194 double z = f * a_axis(2);
2197 double c = ::cos(a_angleRad);
2198 double s = ::sin(a_angleRad);
2202 m(0,0) = x*x*v+c; m(0,1) = x*y*v-z*s; m(0,2) = x*z*v+y*s;
2203 m(1,0) = x*y*v+z*s; m(1,1) = y*y*v+c; m(1,2) = y*z*v-x*s;
2204 m(2,0) = x*z*v-y*s; m(2,1) = y*z*v+x*s; m(2,2) = z*z*v+c;
2206 (*this) = (*this)*m;
2230 const double& a_angleDeg)
2255 const double& a_axisY,
2256 const double& a_axisZ,
2257 const double& a_angleRad)
2282 const double& a_axisY,
2283 const double& a_axisZ,
2284 const double& a_angleDeg)
2307 double& a_angle)
const
2310 double epsilon1 = 0.01;
2311 double epsilon2 = 0.1;
2313 if ((fabs((*
this)(0,1) - (*
this)(1,0)) < epsilon1) &&
2314 (fabs((*
this)(0,2) - (*
this)(2,0)) < epsilon1) &&
2315 (fabs((*
this)(1,2) - (*
this)(2,1)) < epsilon1))
2320 if ( (fabs((*
this)(0,1) + (*
this)(1,0)) < epsilon2) &&
2321 (fabs((*
this)(0,2) + (*
this)(2,0)) < epsilon2) &&
2322 (fabs((*
this)(1,2) + (*
this)(2,1)) < epsilon2) &&
2323 (fabs((*
this)(0,0) + (*
this)(1,1) + (*
this)(2,2)-3) < epsilon2))
2333 double xx = ((*this)(0,0)+1)/2;
2334 double yy = ((*this)(1,1)+1)/2;
2335 double zz = ((*this)(2,2)+1)/2;
2336 double xy = ((*this)(0,1)+(*
this)(1,0))/4;
2337 double xz = ((*this)(0,2)+(*
this)(2,0))/4;
2338 double yz = ((*this)(1,2)+(*
this)(2,1))/4;
2340 if ((xx > yy) && (xx > zz))
2361 x = 0.7071067811865475;
2363 z = 0.7071067811865475;
2377 x = 0.7071067811865475;
2378 y = 0.7071067811865475;
2395 double s = sqrt(((*
this)(2,1) - (*
this)(1,2))*((*
this)(2,1) - (*
this)(1,2)) +
2396 ((*
this)(0,2) - (*
this)(2,0))*((*
this)(0,2) - (*
this)(2,0)) +
2397 ((*
this)(1,0) - (*
this)(0,1))*((*
this)(1,0) - (*
this)(0,1)));
2402 if (fabs(s) < 0.001) s=1;
2404 angle = acos(( (*
this)(0,0) + (*
this)(1,1) + (*
this)(2,2) - 1)/2);
2405 x = ((*this)(2,1) - (*
this)(1,2))/s;
2406 y = ((*this)(0,2) - (*
this)(2,0))/s;
2407 z = ((*this)(1,0) - (*
this)(0,1))/s;
2432 inline std::string
str(
const unsigned int a_precision = 2)
const
2435 result.append(
"[ ");
2437 for (
int i=0; i<3; i++)
2439 result.append(
"( ");
2440 for (
int j=0; j<3; j++)
2442 result.append(
cStr((*
this)(j,i), a_precision));
2445 result.append(
", ");
2448 result.append(
" ) ");
2459 (*this)(0,0) *= a_val; (*this)(0,1) *= a_val; (*this)(0,2) *= a_val;
2460 (*this)(1,0) *= a_val; (*this)(1,1) *= a_val; (*this)(1,2) *= a_val;
2461 (*this)(2,0) *= a_val; (*this)(2,1) *= a_val; (*this)(2,2) *= a_val;
2469 mulr(a_val, result);
2493 (*this)(0,0) += a_input(0,0);
2494 (*this)(0,1) += a_input(0,1);
2495 (*this)(0,2) += a_input(0,2);
2497 (*this)(1,0) += a_input(1,0);
2498 (*this)(1,1) += a_input(1,1);
2499 (*this)(1,2) += a_input(1,2);
2501 (*this)(2,0) += a_input(2,0);
2502 (*this)(2,1) += a_input(2,1);
2503 (*this)(2,2) += a_input(2,2);
2510 (*this)(0,0) -= a_input(0,0);
2511 (*this)(0,1) -= a_input(0,1);
2512 (*this)(0,2) -= a_input(0,2);
2514 (*this)(1,0) -= a_input(1,0);
2515 (*this)(1,1) -= a_input(1,1);
2516 (*this)(1,2) -= a_input(1,2);
2518 (*this)(2,0) -= a_input(2,0);
2519 (*this)(2,1) -= a_input(2,1);
2520 (*this)(2,2) -= a_input(2,2);
2525 inline double&
operator() (
const int a_index0,
const int a_index1)
2527 return m_data[a_index0][a_index1];
2532 inline const double&
operator() (
const int a_index0,
const int a_index1)
const
2534 return m_data[a_index0][a_index1];
2545 double m_data[3][3];
2558 a_matrix.
mulr(a_vector, result);
2568 a_matrix1.
mulr(a_matrix2, result);
2577 a_matrix.
mulr(a_scalar, result);
2587 a_matrix1.
addr(a_matrix2, result);
2597 a_matrix1.
subr(a_matrix2, result);
Implements mathematical constants.
Definition CAudioBuffer.cpp:57
cMatrix3d operator-(const cMatrix3d &a_matrix1, const cMatrix3d &a_matrix2)
An overloaded - operator for matrix/matrix addition.
Definition CMatrix3d.h:2593
std::string cStr(const bool a_value)
This function converts a boolean into a string.
Definition CString.cpp:189
const double C_RAD2DEG
Conversion from radians to degrees.
Definition CConstants.h:97
const double C_TINY
Smallest value near zero for a double.
Definition CConstants.h:100
const double C_PI
PI constant.
Definition CConstants.h:88
cMatrix3d operator+(const cMatrix3d &a_matrix1, const cMatrix3d &a_matrix2)
An overloaded + operator for matrix/matrix addition.
Definition CMatrix3d.h:2583
const double C_PI_DIV_2
PI constant divided by two.
Definition CConstants.h:91
cVector3d operator*(const cMatrix3d &a_matrix, const cVector3d &a_vector)
An overloaded * operator for matrix/vector multiplication.
Definition CMatrix3d.h:2554
const double C_DEG2RAD
Conversion from degrees to radians.
Definition CConstants.h:94
cEulerOrder
Definition CMatrix3d.h:58
@ C_EULER_ORDER_ZXY
Definition CMatrix3d.h:67
@ C_EULER_ORDER_YXY
Definition CMatrix3d.h:66
@ C_EULER_ORDER_ZXZ
Definition CMatrix3d.h:68
@ C_EULER_ORDER_XZX
Definition CMatrix3d.h:62
@ C_EULER_ORDER_YZY
Definition CMatrix3d.h:64
@ C_EULER_ORDER_ZYZ
Definition CMatrix3d.h:70
@ C_EULER_ORDER_XYX
Definition CMatrix3d.h:60
@ C_EULER_ORDER_YZX
Definition CMatrix3d.h:63
@ C_EULER_ORDER_ZYX
Definition CMatrix3d.h:69
@ C_EULER_ORDER_XZY
Definition CMatrix3d.h:61
@ C_EULER_ORDER_XYZ
Definition CMatrix3d.h:59
@ C_EULER_ORDER_YXZ
Definition CMatrix3d.h:65
This class implements a 3D matrix.
Definition CMatrix3d.h:98
void addr(const cMatrix3d &a_matrix, cMatrix3d &a_result) const
This method computes the addition of this matrix with another.
Definition CMatrix3d.h:785
void subr(const cMatrix3d &a_matrix, cMatrix3d &a_result) const
This method computes the subtraction of this matrix with another.
Definition CMatrix3d.h:850
void mul(const double &a_scalar)
This function computes the multiplication of this matrix by a scalar.
Definition CMatrix3d.h:882
void setCol2(const cVector3d &a_vectCol)
This method initializes column 2 of this matrix.
Definition CMatrix3d.h:491
bool invert()
This method computes the inverse of this matrix.
Definition CMatrix3d.h:1144
void setExtrinsicEulerRotationRad(const double &a_angle1, const double &a_angle2, const double &a_angle3, const cEulerOrder a_eulerOrder)
This method builds a rotation matrix from an Euler angle representation.
Definition CMatrix3d.h:1408
std::string str(const unsigned int a_precision=2) const
This method converts this matrix to a string representation.
Definition CMatrix3d.h:2432
bool rotateAboutLocalAxisDeg(const double &a_axisX, const double &a_axisY, const double &a_axisZ, const double &a_angleDeg)
This method rotates this matrix around an axis described in local coordinates.
Definition CMatrix3d.h:2281
cVector3d getCol0() const
This method returns column vector 0 of matrix.
Definition CMatrix3d.h:536
bool rotateAboutGlobalAxisRad(const double &a_axisX, const double &a_axisY, const double &a_axisZ, const double &a_angleRad)
This method rotates this matrix around an axis described in global coordinates.
Definition CMatrix3d.h:2125
void setCol1(const cVector3d &a_vectCol)
This method initializes column 1 of this matrix.
Definition CMatrix3d.h:471
void setIntrinsicEulerRotationDeg(const double &a_angle1, const double &a_angle2, const double &a_angle3, const cEulerOrder a_eulerOrder)
This method builds a rotation matrix from an Euler angle representation.
Definition CMatrix3d.h:1615
cMatrix3d(const cVector3d &a_axis, const double &a_angleRad)
Definition CMatrix3d.h:264
bool setAxisAngleRotationRad(const cVector3d &a_axis, const double &a_angleRad)
This method builds a rotation matrix from an axis-angle representation.
Definition CMatrix3d.h:1282
void mulr(const cMatrix3d &a_matrix, cMatrix3d &a_result) const
This function computes the multiplication of this matrix with another.
Definition CMatrix3d.h:989
void mulr(const double &a_scalar, cMatrix3d &a_result) const
This function computes the multiplication of this matrix by a scalar.
Definition CMatrix3d.h:916
bool rotateAboutLocalAxisRad(const cVector3d &a_axis, const double &a_angleRad)
This method rotates this matrix around an axis described in local coordinates.
Definition CMatrix3d.h:2177
double det() const
This method computes and returns the determinant of this matrix.
Definition CMatrix3d.h:1072
bool rotateAboutLocalAxisDeg(const cVector3d &a_axis, const double &a_angleDeg)
This method rotates this matrix around an axis described in local coordinates.
Definition CMatrix3d.h:2229
void operator+=(const cMatrix3d &a_input)
An overloaded += operator for matrix/matrix addition.
Definition CMatrix3d.h:2491
void mul(cVector3d &a_vector) const
This function computes the multiplication of this matrix with a vector.
Definition CMatrix3d.h:1023
cVector3d operator*(const cVector3d &a_val)
An overloaded * operator for matrix/vector multiplication.
Definition CMatrix3d.h:2466
void add(const cMatrix3d &a_matrix)
This method computes the addition of this matrix with another.
Definition CMatrix3d.h:752
void set(const double a_source[3][3])
This method initializes this matrix from an array.
Definition CMatrix3d.h:365
bool rotateAboutGlobalAxisDeg(const double &a_axisX, const double &a_axisY, const double &a_axisZ, const double &a_angleDeg)
This method rotates this matrix around an axis described in global coordinates.
Definition CMatrix3d.h:2152
cMatrix3d(const cVector3d &a_colVector0, const cVector3d &a_colVector1, const cVector3d &a_colVector2)
Definition CMatrix3d.h:171
cMatrix3d()
Definition CMatrix3d.h:110
double & operator()(const int a_index0, const int a_index1)
An overloaded () operator.
Definition CMatrix3d.h:2525
void setIntrinsicEulerRotationRad(const double &a_angle1, const double &a_angle2, const double &a_angle3, const cEulerOrder a_eulerOrder)
This method builds a rotation matrix from an Euler angle representation.
Definition CMatrix3d.h:1510
void copyfrom(const cMatrix3d &a_source)
This method copies all elements from another matrix to this one.
Definition CMatrix3d.h:675
bool invertr(cMatrix3d &a_result) const
This method computes the inverse of this matrix.
Definition CMatrix3d.h:1199
bool getIntrinsicEulerAnglesDeg(cVector3d &a_eulerAngles1, cVector3d &a_eulerAngles2, const cEulerOrder a_eulerOrder)
This method computes the intrinsic Euler angle representations for this matrix in degrees.
Definition CMatrix3d.h:2009
bool equals(cMatrix3d &a_matrix) const
This method compares if two matrices are equal.
Definition CMatrix3d.h:722
bool rotateAboutGlobalAxisDeg(const cVector3d &a_axis, const double &a_angleDeg)
This method rotates this matrix around an axis described in global coordinates.
Definition CMatrix3d.h:2100
bool rotateAboutLocalAxisRad(const double &a_axisX, const double &a_axisY, const double &a_axisZ, const double &a_angleRad)
This method rotates this matrix around an axis described in local coordinates.
Definition CMatrix3d.h:2254
void operator*=(const double &a_val)
An overloaded *= operator for matrix/scalar multiplication.
Definition CMatrix3d.h:2457
void set(const double &a_m00, const double &a_m01, const double &a_m02, const double &a_m10, const double &a_m11, const double &a_m12, const double &a_m20, const double &a_m21, const double &a_m22)
This method initializes this matrix with individual elements passed as arguments.
Definition CMatrix3d.h:400
cMatrix3d(const double &a_angle1, const double &a_angle2, const double &a_angle3, const cEulerOrder a_eulerOrder, const bool a_useIntrinsicEulerModel=true, const bool a_anglesDefinedInDegrees=false)
Definition CMatrix3d.h:222
void copyto(cMatrix3d &a_destination) const
This method copies all elements of this matrix to another matrix.
Definition CMatrix3d.h:628
void trans()
This method computes the transpose of this matrix.
Definition CMatrix3d.h:1094
bool getIntrinsicEulerAnglesRad(cVector3d &a_eulerAngles1, cVector3d &a_eulerAngles2, const cEulerOrder a_eulerOrder)
This method computes the intrinsic Euler angle representations for this matrix in radians.
Definition CMatrix3d.h:1763
void mulr(const cVector3d &a_vector, cVector3d &a_result) const
This function computes the multiplication of this matrix with a vector.
Definition CMatrix3d.h:1052
void operator-=(const cMatrix3d &a_input)
An overloaded -= operator for matrix/matrix subtraction.
Definition CMatrix3d.h:2508
void set(const double &a_value)
This method initializes all elements of this matrix with an input value.
Definition CMatrix3d.h:345
void identity()
This method builds an identity matrix.
Definition CMatrix3d.h:325
void mul(const cMatrix3d &a_matrix)
This function computes the multiplication of this matrix with another.
Definition CMatrix3d.h:950
void setExtrinsicEulerRotationDeg(const double &a_angle1, const double &a_angle2, const double &a_angle3, const cEulerOrder a_eulerOrder)
This method builds a rotation matrix from an Euler angle representation.
Definition CMatrix3d.h:1482
bool setAxisAngleRotationDeg(const cVector3d &a_axis, const double &a_angleDeg)
This method builds a rotation matrix from an axis-angle representation.
Definition CMatrix3d.h:1331
bool getExtrinsicEulerAnglesRad(cVector3d &a_eulerAngles1, cVector3d &a_eulerAngles2, const cEulerOrder a_eulerOrder)
This method computes the extrinsic Euler angle representations for this matrix in radians.
Definition CMatrix3d.h:1645
bool setAxisAngleRotationDeg(const double &a_axisX, const double &a_axisY, const double &a_axisZ, const double &a_angleDeg)
This method builds a rotation matrix from axis-angle representation.
Definition CMatrix3d.h:1383
cVector3d getCol1() const
This method returns column vector 1 of matrix.
Definition CMatrix3d.h:557
void get(double *a_destination[])
This method copies matrix elements to a table of doubles
Definition CMatrix3d.h:511
cMatrix3d(const double &a_m00, const double &a_m01, const double &a_m02, const double &a_m10, const double &a_m11, const double &a_m12, const double &a_m20, const double &a_m21, const double &a_m22)
Definition CMatrix3d.h:151
void transr(cMatrix3d &a_result) const
This method computes the transpose of this matrix.
Definition CMatrix3d.h:1116
cMatrix3d(const double &a_axisX, const double &a_axisY, const double &a_axisZ, const double &a_angleRad)
Definition CMatrix3d.h:282
bool getExtrinsicEulerAnglesDeg(cVector3d &a_eulerAngles1, cVector3d &a_eulerAngles2, const cEulerOrder a_eulerOrder)
This method computes the extrinsic Euler angle representations for this matrix in degrees.
Definition CMatrix3d.h:1723
bool setAxisAngleRotationRad(const double &a_axisX, const double &a_axisY, const double &a_axisZ, const double &a_angleRad)
This method builds a rotation matrix from an axis-angle representation.
Definition CMatrix3d.h:1356
bool toAxisAngle(cVector3d &a_axis, double &a_angle) const
This method converts this rotation matrix to an axis-angle representation.
Definition CMatrix3d.h:2306
bool rotateAboutGlobalAxisRad(const cVector3d &a_axis, const double &a_angleRad)
This method rotates this matrix around an axis described in global coordinates.
Definition CMatrix3d.h:2048
void setCol0(const cVector3d &a_vectCol)
This method initializes column 0 of this matrix.
Definition CMatrix3d.h:451
void sub(const cMatrix3d &a_matrix)
This method computes the subtraction of this matrix with another.
Definition CMatrix3d.h:817
void setCol(const cVector3d &a_vectCol0, const cVector3d &a_vectCol1, const cVector3d &a_vectCol2)
This method initialize this matrix with column vectors passed as arguments.
Definition CMatrix3d.h:429
cVector3d getRow(const unsigned int &a_index) const
This method returns the i th row of matrix.
Definition CMatrix3d.h:602
void orthogonalize()
This method orthogonalizes this matrix.
Definition CMatrix3d.h:1247
cVector3d getCol2() const
This method returns column vector 2 of matrix.
Definition CMatrix3d.h:578
This class implements a 3D vector.
Definition CVector3d.h:89
void normalize()
This method normalizes this vector to length 1.
Definition CVector3d.h:1034
void set(const double &a_x, const double &a_y, const double &a_z)
This method initializes this vector with components x, y, and z passed as arguments.
Definition CVector3d.h:278
void crossr(const cVector3d &a_vector, cVector3d &a_result) const
This method computes the cross product.
Definition CVector3d.h:955
double length() const
This method computes the Euclidean norm of this vector.
Definition CVector3d.h:995