Working for rotation

But due to obvious issues with algorithm. Not giving output as expected.