CodeRush Screenshot of the Week – Rotate 90 Degrees

You may have noticed this entry showing up in the Code menu and wondered “What does Rotate 90 Degrees do?”. This code provider is useful when you are working in a two-dimensional space, and you’ve written code to work in one dimension and you want to create similar code to work in the other dimension.

Here I’ve taken the first method, CalculateHorizontalPosition that works on the x-axis, copied it, and now I’m converting it into a functionally similar method that works on the y-axis: