Edit in JSFiddle

var $canvas = $('canvas:first');
var ctx = $canvas[0].getContext('2d');
var height = $canvas[0].height;
var width = $canvas[0].width;

// Calculate a point on a circle
function circle(t, radius) {
    var r = radius || 100,
        arc = Math.PI * 2;

    // calculate current angle
    var alpha = t * arc;

    // calculate current coords
    var x = Math.sin(alpha) * r,
        y = Math.cos(alpha) * r;

    // return coords
    return [x, y * -1];
}

// Draw a Circle
function draw(e) {
    ctx.beginPath();
    // draw the circle in 1000 segments
    for (var i = 0; i <= 1000; i++) {
        //time is the percentage of completion
        var t = i / 1000;
        
        // request a point in time on a circle
        var p = circle(t, height / 2);
        
        // move the drawing cursor to the start position
        if (i == 0) {
            ctx.moveTo(p[0] + width / 2, p[1] + height / 2);
        }
        
        // draw a line segment
        ctx.lineTo(p[0] + width / 2, p[1] + height / 2);
    }
    ctx.stroke();
}
draw();