add RPY to mat and vice versa