The Murder / Suicide flight is almost certain to be due to a bug in the current Matrix:
|Xe| = |cos(pitch), 0, sin(pitch)||Xq| |Ye| = |0, cos(roll), sin(roll)||Yq| |Ze| = |sin(pitch), sin(roll), cos(pitch)cos(roll)||Zq|
I’ve arranged it such that if Phoebe is nose down, or left-side down, the pitch and roll angles are negative respectively.
Forward, leftward and upward movement results in positive accelerometer values.
The diagram below shows the vectors representing Phoebe pitching nose down and moving right to left as a result. Her sensor vectors are in gold, and their translation to earth axis vectors in black. Phoebe is pitched nose downwards, so the angle of pitch is negative.
Here’s the revised value of the Matrix that ensures the earth vectors match those shown in the picture.
|Xe| = |cos(pitch), 0, -sin(pitch)||Xq|
|Ye| = |0, cos(roll), -sin(roll)||Yq|
|Ze| = |sin(pitch), sin(roll), cos(pitch)cos(roll)||Zq|
Critically, this means that when calculating eax based upon the faz vector, because the pitch angle is negative, so is sin(pitch), yet the eax vector is showing forward (and therefore positive) acceleration. Hence right hand column of the matrix where it shows -sin(pitch) and -sin(roll).
The same is not necessary when deriving eaz from the fax vector; eaz is shown as negative, and so fax*sin (pitch) already produces the correct negative result.
The case for the y axis is identical.
Hopefully there will a slot in the weather tomorrow for me to test this.