Optimised rotation detection.