20 #ifndef AHRS_FLOAT_DCM_ALGEBRA_H
21 #define AHRS_FLOAT_DCM_ALGEBRA_H
26 return vector1[0] * vector2[0] + vector1[1] * vector2[1] + vector1[2] * vector2[2];
31 vectorOut[0] = (
v1[1] *
v2[2]) - (
v1[2] *
v2[1]);
32 vectorOut[1] = (
v1[2] *
v2[0]) - (
v1[0] *
v2[2]);
33 vectorOut[2] = (
v1[0] *
v2[1]) - (
v1[1] *
v2[0]);
36 static inline void Vector_Scale(
float vectorOut[3],
float vectorIn[3],
float scale2)
38 vectorOut[0] = vectorIn[0] * scale2;
39 vectorOut[1] = vectorIn[1] * scale2;
40 vectorOut[2] = vectorIn[2] * scale2;
43 static inline void Vector_Add(
float vectorOut[3],
float vectorIn1[3],
float vectorIn2[3])
45 vectorOut[0] = vectorIn1[0] + vectorIn2[0];
46 vectorOut[1] = vectorIn1[1] + vectorIn2[1];
47 vectorOut[2] = vectorIn1[2] + vectorIn2[2];
67 for (
int x = 0; x < 3; x++) {
68 for (
int y = 0; y < 3; y++) {
69 for (
int w = 0; w < 3; w++) {
70 op[w] = a[x][w] *
b[w][y];
72 mat[x][y] = op[0] + op[1] + op[2];
static void Vector_Add(float vectorOut[3], float vectorIn1[3], float vectorIn2[3])
static void Matrix_Multiply(float a[3][3], float b[3][3], float mat[3][3])
static void Vector_Scale(float vectorOut[3], float vectorIn[3], float scale2)
static float Vector_Dot_Product(float vector1[3], float vector2[3])
static void Vector_Cross_Product(float vectorOut[3], float v1[3], float v2[3])