title: Rotate 2D Array by 45 degrees
body: <p>How can I rotate a 2D rectangular array of integers that has odd number of rows by 45 degrees?</p>
  
  <p>So something like </p>
  
  <pre><code>int[] myArray = new int[,]   
  {  
      {1, 0 ,1},  
      {0, 1 ,0},  
      {0, 0 ,0},  
  } 
  </code></pre>
  
  <p>into  </p>
  
  <pre><code>int[] rotatedArray = new int[,]   
  {  
      {0, 1 ,0},  
      {0, 1 ,1},  
      {0, 0 ,0},  
  }  
  </code></pre>
  
  <p>for any dimension (3x3, 5x5, 7x7, etc.).</p>
  
  <p><b>5x5</b></p>
  
  <pre><code>0 0 0 0 0  
  2 0 0 0 0  
  1 1 1 1 1  
  0 0 0 0 0  
  0 0 0 0 0 
  </code></pre>
  
  <p>into</p>
  
  <pre><code>1 2 0 0 0  
  0 1 0 0 0  
  0 0 1 0 0  
  0 0 0 1 0  
  0 0 0 0 1 
  </code></pre>
  
  <p><b>5x5</b></p>
  
  <pre><code>0 0 0 3 0  
  0 0 0 3 0  
  0 0 0 3 0  
  0 0 0 3 0  
  0 0 0 3 0 
  </code></pre>
  
  <p>into</p>
  
  <pre><code>0 0 0 0 0  
  0 0 0 0 3  
  0 0 0 3 0  
  0 0 3 3 0  
  0 3 0 0 0  
  </code></pre>