apply_rotation function

Apply rotation