Artificial intelligent assistant

Compute Roll/Pitch of a Body Rotated Relative to Another If I have two "ships", a "daughter" ship lying flat on top of a "mother" ship but with a different heading and both ships are then rotated about the roll and pitch axes of the mother ship, how can I calculate the roll/pitch of the daughter ship from the resulting roll and pitch values of the mothership? The linked image may help to understand what I am asking. The daughter ship is lying flat on the same X-Y plane as the mother ship but is rotated about the Z axis, i.e. it has a different heading. If both ships are then tilted together and I know the roll and pitch of the mother ship, how do I calculate the roll and pitch of the daughter ship? Roll Pitch Calculation

Just been given this formula by a colleague and it seems to work fine. I'll mark it as an answer for now and it may be useful for someone else in future. If (h) is the heading offset (clockwise rotation) of the daughter ship from the mother ship about the Z axis (alpha in the linked image), (r) is the roll of the mother ship and (p) is the pitch of the mother ship, then;

Daughter ship Roll = $-arcsin(cos(h+90)*sin(p)-sin(h+90)*sin(r))$

Daughter ship Pitch = $arcsin(cos(h)*sin(p)-sin(h)*sin(r))$

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy fd33dd091e04c02b33911fc577a686ba