1function drawRotated(degrees){
2 context.clearRect(0,0,canvas.width,canvas.height);
3 context.save();
4 context.translate(canvas.width/2,canvas.height/2);
5 context.rotate(degrees*Math.PI/180);
6 context.drawImage(image,-image.width/2,-image.width/2);
7 context.restore();
8}