Trying to plot coordinates around the edge of a circle Trying to plot coordinates around the edge of a circle javascript javascript

Trying to plot coordinates around the edge of a circle


Assuming that (x0, y0) is the center of your circle, and r is the radius:

var items = 4;for(var i = 0; i < items; i++) {    var x = x0 + r * Math.cos(2 * Math.PI * i / items);    var y = y0 + r * Math.sin(2 * Math.PI * i / items);       $("#center").append("<div class='point' style='left:"+ x +"px;top:"+ y +"px'></div>");    }