Calculating coordinates to rotate