Say I have a quaternion q which describes how to get from frame 0 to frame 1, and a quaternion r which describes how to get from frame 0 to frame 2. To get the "quaternion difference" between q and r, I do
$$ q_{d} = q^{-1} r $$ This is however in frame 1. How do I get the quaternion difference in frame 0?