This is a new try with the simple maths that we already know. I have used basic trigonometric equations and JQuery animation for the play. DEMO Demo Explained: Create set of div and append it to the body for (var i = 0; i < 360; i++) { //random color var color = '#'+parseInt(Math.random()*0xccccc); //create and append DOM $('<div/>').appendTo('body').css('background',color); } For random positioning use Math.random() to generate random x,y values for (var i = 0; i < 360; i++) { var left = 100 + Math.random() * 300 + 'px'; var top = 100 + Math.random() * 300 + 'px'; $('div').eq(i).animate({left:left,top:top},1000); } To draw circle , x = tx + r cos(t) y = ty + r sin(t) so looping through t value from 0 to 360 will generate circle for (var i = 0; i < 360; i++) { r = 150; var left = 400 + r*Math.cos(i); var top = 200 + r*Math.sin(i); ...
Javascript tips and tricks, JQuery tips & tricks, JQuery Plugins, CSS Tricks and Tips, things you may not know about javascript, AngularJS tips and tricks, Laravel, PHP tips and tricks, computer programming, grapical user interface using c, c header files, computer graphics lab program, 2d translation, 3d translation, line drawing algorithm, circle drawing algorithm, DDA, Midpoint, 3D projection using c, Personal diary, Mini project using c, Graphical User Interface using C