VectorNav C Library
matrix.h
1 #ifndef VN_MATRIX_H_INCLUDED
2 #define VN_MATRIX_H_INCLUDED
3 
4 #include "vn/util/compiler.h"
5 
6 #ifdef __cplusplus
7 extern "C" {
8 #endif
9 
11 typedef union
12 {
13  float e[3*3];
15  /* Check if the compiler supports anonymous unions. */
16  #if defined(__STDC_VERSION___) && (__STDC_VERSION__ >= 201112L) && defined(__GNUC__)
17 
18  struct
19  {
20  float e00;
21  float e10;
22  float e20;
23  float e01;
24  float e11;
25  float e21;
26  float e02;
27  float e12;
28  float e22;
29  };
30 
31  #endif
32 
33 } mat3f;
34 
36 typedef union
37 {
38  float c[4];
40  /* Check if the compiler supports anonymous unions. */
41  #if defined(__STDC_VERSION___) && (__STDC_VERSION__ >= 201112L) && defined(__GNUC__)
42 
43  struct
44  {
45  float x;
46  float y;
47  float z;
48  float w;
49  };
50 
51  struct
52  {
53  float c0;
54  float c1;
55  float c2;
56  float c3;
57  };
58 
59  #endif
60 
61 } quatf;
62 
68 void vn_m3_init_fa(mat3f* m, const float* fa);
69 
75 void strFromMat3f(char* out, mat3f m);
76 
80 mat3f vnm_negative_mat3f(mat3f m);
81 
82 #ifdef __cplusplus
83 }
84 #endif
85 
86 #endif
87 
Represents a 3x3 matrix with an underlying data type of float.
Definition: matrix.h:11
Represents a quaternion reading with underlying data type of float.
Definition: matrix.h:36