title: Just scaling a rectangle
body: <p>I'm trying to start with processing.</p>
  
  <p>Now I'm just trying to scale a rectangle. I have found this example:</p>
  
  
  
  <pre class="lang-java prettyprint-override"><code>float a = 0.0;
  float s = 0.0;
  
  void setup()
  {
    size(200,200);
    rectMode(CENTER);
    frameRate(30);
  }
  
  void draw()
  {
  
    s = s + 0.04;
  
    translate(width/2, height/2);
    scale(s); 
    rect(0, 0, 50, 50); 
  
  }
  </code></pre>
  
  <p>It scales smoothly the rectangle but I'm a bit surprise because for resizing a rectangle I expected the sizing parameters (3rd and 4th) of rect() were modified, something like this way:</p>
  
  <pre class="lang-java prettyprint-override"><code>float r = 1;
  
  void setup()
  {
    size(200,200);
    rectMode(CENTER);
    frameRate(30);
  }
  
  void draw(){
  
      rect(width/2, height/2, r, r);  
  
      r += 1;
  
  }
  </code></pre>
  
  <p>but this way doesn't scale the rectangle smoothly. So, should I use the first approach instead of the second one even if I find it the second one more natural? Any comment will be wellcome.</p>
  
  <p>Regards</p>
  
  <p>Javier</p>