I am trying to draw a spiral from divs using jquery. I have done a regular spiral so far and seems to work fine for me. However the next step is that I need this to have big distance between divs when it starts and smaller one as it goes. I know that I should add an extra variable that will do this but I do not know how to implement this.
Here is my code so far
var radius = 50;
var x0 = 300;
var y0 = 300;
var segment = 50;
var angle = 0;
for (var i=0; i<=segment; i++){
angle = angle + (Math.PI * 2) / 30;
var x=x0+radius*Math.sin(angle);
var y=y0+radius*Math.cos(angle);
$("#terrain").append("<div class='drag' style='top:"+ y +"px;left:"+ x +"px;'></div>")
radius = radius + 5;
}