title: Making a spinning spiral
body: <p>I have found a code to draw spiral and I need to make it spin 360 degrees (something like hypnotizing effect). I tried to animate it, but I don't know how to implement it properly. I am running out of time. It would be great if that code would be as simple as possible.</p>
  
  <p>Here's the spiral code:</p>
  
  <pre><code>&lt;canvas id="myCanvas" width="300" height="300"&gt;&lt;/canvas&gt;
  &lt;script type="text/javascript"&gt;
      var c=document.getElementById("myCanvas");
      var cxt=c.getContext("2d");
      var centerX = 150;
      var centerY = 150;
      cxt.moveTo(centerX, centerY);
  
      var STEPS_PER_ROTATION = 60;
      var increment = 2*Math.PI/STEPS_PER_ROTATION;       
      var theta = increment;
  
      while( theta &lt; 40*Math.PI) {
        var newX = centerX + theta * Math.cos(theta); 
        var newY = centerY + theta * Math.sin(theta); 
        cxt.lineTo(newX, newY);
        theta = theta + increment;
      }
      cxt.stroke();
  &lt;/script&gt;
  </code></pre>