# Maths

1 Euro Filter is a fast lowpass filter ideal for human motions:

http://cristal.univ-lille.fr/~casiez/1euro/

real time demo: http://cristal.univ-lille.fr/~casiez/1euro/InteractiveDemo/

How to transform position and quaternions from a y-up coordinate system to a z-up coordinate system.

With the help of this transformation matrix

``````    matrix_yUp_to_zUp:
(
1,  0,  0,  0,
0,  0,  1,  0,
0,  -1, 0,  0,
0,  0,  0,  1
);

matrix_zUp_to_yUp:
(
1,  0,  0,  0,
0,  0,  -1,  0,
0,  1, 0,  0,
0,  0,  0,  1
);``````

All you have to do is multiply your vector or matrix from the Z-up system with the transformation matrix which converts Z-up into Y-up:

``yUp = someZupVectorOrMatrix * matrix_yUp_to_zUp``

This flips the axes by taking the +Z as +Y and the +Y as -Z and will convert rotation and scale parts correctly, too. To convert from Y-up back to Z-up, just use the inverse() of the conversion matrix above which is

``zUp = someYupVectorOrMatrix * matrix_zUp_to_yUp``

or alternatively from y-up to z-up for position and quaternion:

``````float pxt, pyt, pzt, qxt, qyt, qzt, qwt = 0.0f;

pxt = rbData.x;
pyt = -rbData.z;
pzt = rbData.y;
qxt = rbData.qx;
qyt = -rbData.qz;
qzt = rbData.qy;
qwt = rbData.qw;``````