40 #include <px4_platform_common/defines.h> 73 tmp = M_SQRT1_2_F * (x - y);
74 y = M_SQRT1_2_F * (x + y);
80 tmp = x; x = -y; y = tmp;
85 tmp = -M_SQRT1_2_F * (x + y);
86 y = M_SQRT1_2_F * (x - y);
96 tmp = M_SQRT1_2_F * (y - x);
97 y = -M_SQRT1_2_F * (x + y);
103 tmp = x; x = y; y = -tmp;
108 tmp = M_SQRT1_2_F * (x + y);
109 y = M_SQRT1_2_F * (y - x);
120 tmp = M_SQRT1_2_F * (x + y);
121 y = M_SQRT1_2_F * (x - y);
127 tmp = x; x = y; y = tmp; z = -z;
132 tmp = M_SQRT1_2_F * (y - x);
133 y = M_SQRT1_2_F * (y + x);
144 tmp = -M_SQRT1_2_F * (x + y);
145 y = M_SQRT1_2_F * (y - x);
151 tmp = x; x = -y; y = -tmp; z = -z;
156 tmp = M_SQRT1_2_F * (x - y);
157 y = -M_SQRT1_2_F * (x + y);
163 tmp = z; z = y; y = -tmp;
168 tmp = z; z = y; y = -tmp;
169 tmp = M_SQRT1_2_F * (x - y);
170 y = M_SQRT1_2_F * (x + y);
176 tmp = z; z = y; y = -tmp;
177 tmp = x; x = -y; y = tmp;
182 tmp = z; z = y; y = -tmp;
183 tmp = -M_SQRT1_2_F * (x + y);
184 y = M_SQRT1_2_F * (x - y);
190 tmp = z; z = -y; y = tmp;
195 tmp = z; z = -y; y = tmp;
196 tmp = M_SQRT1_2_F * (x - y);
197 y = M_SQRT1_2_F * (x + y);
203 tmp = z; z = -y; y = tmp;
204 tmp = x; x = -y; y = tmp;
209 tmp = z; z = -y; y = tmp;
210 tmp = -M_SQRT1_2_F * (x + y);
211 y = M_SQRT1_2_F * (x - y);
217 tmp = z; z = -y; y = tmp;
218 tmp = x; x = y; y = -tmp;
223 tmp = z; z = -x; x = tmp;
228 tmp = z; z = x; x = -tmp;
233 tmp = z; z = x; x = tmp;
239 tmp = x; x = z; z = tmp;
254 x = 0.143039f * tmpx + 0.368776f * tmpy + -0.918446f * tmpz;
255 y = -0.332133f * tmpx + -0.856289f * tmpy + -0.395546f * tmpz;
256 z = -0.932324f * tmpx + 0.361625f * tmpy + 0.000000f * tmpz;
270 x = -0.987688f * tmpx + 0.000000f * tmpy + -0.156434f * tmpz;
271 y = 0.000000f * tmpx + -1.000000f * tmpy + 0.000000f * tmpz;
272 z = -0.156434f * tmpx + 0.000000f * tmpy + 0.987688f * tmpz;
277 tmp = M_SQRT1_2_F * x + M_SQRT1_2_F * z;
278 z = M_SQRT1_2_F * z - M_SQRT1_2_F * x;
284 tmp = M_SQRT1_2_F * x - M_SQRT1_2_F * z;
285 z = M_SQRT1_2_F * z + M_SQRT1_2_F * x;
__EXPORT void rotate_3f(enum Rotation rot, float &x, float &y, float &z)
rotate a 3 element float vector in-place
Rotation
Enum for board and external compass rotations.
constexpr T radians(T degrees)
const rot_lookup_t rot_lookup[]
__EXPORT matrix::Dcmf get_rot_matrix(enum Rotation rot)
Get the rotation matrix.
__EXPORT matrix::Quatf get_rot_quaternion(enum Rotation rot)
Get the rotation quaternion.