What I want to achieve is to store coordinates of all the points which make up the circumference of a circle. I know that this is virtually impossible as there are infinite points on the circumference of a circle but lets say I want to store coordinate found after every 1cm on the circumference of a circle. and the circles circumference is 50cm so in actual i will be storing 25 values in my array.
This is what I have tried so far:
for(var degree=0;degree<360;degree++){
var radians = degree * Math.PI/180;
var x = center + radius * Math.cos(radians);
var y = center + radius * Math.sin(radians);
//x & y are the coordinates of points on the circumference
}
But my above code is not working as desired. Help will be highly appreciated!