Arrange DIV in circle and rotate them facing outwards
<p>Basically I've managed to layout my DIV elements into a circle shape but I've not managed to work out how to calculate the deg of rotation need to have them face OUTWARD from the center of the circle.</p>

<pre><code>$(document).ready(function(){
                var elems = document.getElementsByClassName('test_box');

                var increase = Math.PI * 2 / elems.length;
                var x = 0, y = 0, angle = 0;

                for (var i = 0; i &lt; elems.length; i++) {
                    var elem = elems[i];
                    // modify to change the radius and position of a circle
                    x = 400 * Math.cos(angle) + 700;
                    y = 400 * Math.sin(angle) + 700;
                    elem.style.position = 'absolute';
                    elem.style.left = x + 'px';
                    elem.style.top = y + 'px';
                    //need to work this part out
                    var rot = 45;
                    elem.style['-moz-transform'] = "rotate("+rot+"deg)";
                    elem.style.MozTransform = "rotate("+rot+"deg)";
                    elem.style['-webkit-transform'] = "rotate("+rot+"deg)";
                    elem.style['-o-transform'] = "rotate("+rot+"deg)";
                    elem.style['-ms-transform'] = "rotate("+rot+"deg)";
                    angle += increase;
                    console.log(angle);
                }
            });
</code></pre>

<p>does anyone have to knowledge on how I can do this.</p>

<p>Cheers -C</p>
