New mathlib, WIP

This commit is contained in:
Anton Babushkin
2013-12-18 19:33:47 +04:00
parent ea107f4151
commit a83e3cd222
31 changed files with 1438 additions and 2677 deletions
+2 -13
View File
@@ -41,22 +41,11 @@
#include "rotation.h"
__EXPORT void
get_rot_matrix(enum Rotation rot, math::Matrix *rot_matrix)
get_rot_matrix(enum Rotation rot, math::Matrix3f *rot_matrix)
{
/* first set to zero */
rot_matrix->Matrix::zero(3, 3);
float roll = M_DEG_TO_RAD_F * (float)rot_lookup[rot].roll;
float pitch = M_DEG_TO_RAD_F * (float)rot_lookup[rot].pitch;
float yaw = M_DEG_TO_RAD_F * (float)rot_lookup[rot].yaw;
math::EulerAngles euler(roll, pitch, yaw);
math::Dcm R(euler);
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
(*rot_matrix)(i, j) = R(i, j);
}
}
rot_matrix->from_euler(roll, pitch, yaw);
}