R/maths_functions.R
eulunity2quaternion.RdConverts Unity's specific (improper) Euler angles into a 4-dimensional quaternion vector (w, x, y, z) for further computations.
eulunity2quaternion(rot_x, rot_y, rot_z)A numeric vector of length 4 representing the unit quaternion c(w, x, y, z).
Unity uses (improper) Euler angles to output their internal quaternion representation.
These angles describe extrinsic rotations around the Z - X - Y coordinate axis.
The angles are given as clockwise when the axis is pointing towards the observer as the coordinate system is left-handed.
If rot_x rot_y and rot_z are columns then this function returns an nx4 matrix where n is the length of the column