Calculate transform offset after local axis of control changes

I am sure something like this has been answered here but I’m not sure how to phrase my search.

So lets say I have an IK arm control that was originally oriented so the X axis pointed up at the shoulder, the Y axis pointed at the ground, and Z pointed forward. I then change the control so X points at the fingers, Y is up and Z still points forward. How would I calculate the offset between the new control and the original? I would like a position and rotation offset which could then be applied to an animation. I am trying to use MVector, but I can’t get exactly what I’m looking for.

You can get the offset by multiplying the world matrix of the new control with the inverse world matrix of the original position, that will give you the offset between the two.

I want to know why need to know the offset and how this offset will help in animation…Can anybody please guide me…??