points-on-circle
v1.0.5
Published
Given the number of points and the radius returns an array of xy coordinates on the circle's perimeter.
Downloads
9
Maintainers
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
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