Calculating change in rotation matrices