1
0
Fork
You've already forked points-on-circle
0
Generate coordinates on a circle's perimeter
  • JavaScript 100%
Evangelos Pragalakis 6fba45cf76 update version
2019年01月17日 18:41:54 +02:00
index.js center circle point 2019年01月17日 18:41:36 +02:00
LICENSE Add LICENSE 2019年01月13日 12:48:11 +00:00
package.json update version 2019年01月17日 18:41:54 +02:00
README.md update README.md 2019年01月17日 18:41:17 +02:00
visual.png add visual.png 2019年01月13日 15:38:20 +02:00

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