<script>
var t;
var speed = 10;
var target = 315;
var iNow = 225;
var r = 100;
var center = 200;
document.onclick = function(){
clearInterval(t);
t = setInterval(() => {
if(iNow == target){
clearInterval(t);
}else{
iNow += speed;
var div = document.createElement("div");
div.className = "box";
document.body.appendChild(div)
div.style.left = Math.cos( Math.PI/180*iNow ) * r + center + "px";
div.style.top = Math.sin( Math.PI/180*iNow ) * r + center + "px";
}
}, 30);
}
</script>