title: HTML5 Canvas Fibonacci Spiral
body: <p>Currently I'm looking at this code but can't figure out what's wrong.</p>
  
  <pre><code> function fibNumbers() {
      return [0, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]
  }
  
  function continiusFib(a) {
      var b = fibNumbers(),
      c = Math.floor(a),
      d = Math.ceil(a);
      if (d &gt;= b.length)
          return null;
      a = Math.pow(a - c, 1.15);
      return b[c] + (b[d] - b[c]) * a
  }
  
  function drawSpiral(pointA, pointB) {
      var b = pointA;
      var c = pointB;
      ctx.translate(b.x, b.y);
      b = Math.sqrt(((c.x - b.x) * (c.x - b.x)) + ((c.y - b.y) * (c.y - b.y)));
      d = 1 / Math.sqrt(((c.x - b.x) * (c.x - b.x)) + ((c.y - b.y) * (c.y - b.y)));
      c = Math.acos(c.x - b.x);
      0 &gt; Math.asin(c.y - b.y) &amp;&amp; (c = 2 * Math.PI - c);
      ctx.rotate(c);
      ctx.scale(b / 5, b / 5);
      var d = Math.PI / 100;
      ctx.moveTo(0, 0);
      for (var e = 0; e &lt; 50 * (fibNumbers().length - 1) ; e++) {
          var f = e * d, g = continiusFib(e / 50),
          h = Math.cos(f) * g,
          f = Math.sin(f) * g;
          ctx.lineTo(h, f);
      }
      ctx.scale(5 / b, 5 / b);
      ctx.rotate(-c);
      //ctx.stroke();
  }
  </code></pre>
  
  <p>What I want is to draw Fibonacci Spiral which is different from Golden Spiral</p>
  
  <p>I also have this <a href="https://stackoverflow.com/questions/33274795/error-on-drawing-fibonacci-in-web">question</a> for other reference.
  <a href="https://i.stack.imgur.com/eLLr5.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eLLr5.jpg" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/iKI2X.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iKI2X.jpg" alt="enter image description here"></a></p>