rotate_copy algorithm and test

Added algorithm and test for rotate_copy