JSFiddle - React, Tailwind, and code Playground
by tmcw
HTML
<canvas id='c'></canvas>
JavaScript
var c = document.getElementById('c');
c.width = 200;
c.height = 200;
var ctx = c.getContext('2d');
ctx.translate(100, 100);
// Math.PI * 2 is one way around the circle
for (var i = 0; i < Math.PI * 2; i += 0.1) {
ctx.fillRect(
// cos provides the x value
Math.cos(i) * 90,
// sin provides the y value
Math.sin(i) * 90,
2, 2);
}