JSFiddle - React, Tailwind, and code Playground

by Pratik Galoria

JavaScript

var centerX = 150;
var centerY = 150;

var gap = 1.8; // increase this for spacing between spiral lines        
var STEPS_PER_ROTATION = 60; // increasing this makes the curve smoother

var increment = 2*Math.PI/STEPS_PER_ROTATION;		
var theta = increment;
while( theta < 20*Math.PI) {
  var newX = centerX + theta * Math.cos(theta) * gap; 
  var newY = centerY + theta * Math.sin(theta) * gap; 
  cxt.lineTo(newX, newY);
  theta = theta + increment;
}