points-on-circle

Given the number of points and the radius returns an array of xy coordinates on the circle's perimeter.

Usage no npm install needed!

<script type="module">
  import pointsOnCircle from 'https://cdn.skypack.dev/points-on-circle';
</script>

README

points-on-circle

Given the number of points returns an array of xy coordinates on the circle's perimeter. Optional: You can give the circle's radius and center point (x , y)

Usage

NPM

pointsOnCircle(NumberOfPoints, radius = 1, x = 0, y = 0)

Where x and y is the center of the circle

let pointsOnCircle = require('points-on-circle')

let numPoints = 4
let rad = 10
let x = width/2
let y = height/2
let points = pointsOnCircle(numPoints ,rad, x, y)
console.log(points) 

License

MIT