title: Processing: function rotate doesn't work properly
body: <p>Hello i'm trying to draw a square in processing using only line() and rotate() functions but i'm having a bit of an issue probably with the rotate function.
  Here is my code for the draw function:</p>
  
  
  
  <pre class="lang-java prettyprint-override"><code>void draw(){
     background(0);
     stroke(255);
     for(int i = 0; i &lt; 4; i++){
         line(0, 0, GRID_SIZE, 0);
         translate(GRID_SIZE, 0);
         rotate(HALF_PI);
     }
  }
  </code></pre>
  
  <p>The result:</p>
  
  <p><img src="https://i.stack.imgur.com/HEILd.png" alt="The result"></p>
  
  <p>Why the bottom and the left lines are tilted even if i rotated by PI/2?
  Thanks in advance!</p>