JSFiddle - React, Tailwind, and code Playground

by Felipe Alfaro

HTML

<svg width="200px" height="200px" viewBox="-1 -1 2 2">
    <path d="
        M 1 0
        A 1 1 0 0 1 -1.8369701987210297e-16 -1
        L 0 0
        " fill="#0000ff" />
</svg>

JavaScript

function getCoordinatesForPercent(percent) {
  const x = Math.cos(2 * Math.PI * percent);
  const y = Math.sin(2 * Math.PI * percent);
  
  return [x, y];
}

console.log(getCoordinatesForPercent(.75))