Drawing a Sphere

24 thoughts
last posted Jan. 16, 2014, 4:27 p.m.

2 earlier thoughts

0

For other meridians we're eventually going to need to draw ellipses that are rotated. Here is some code for drawing a rotated ellipse on an HTML canvas:

context.save();
context.beginPath();
context.translate(center_x, center_y);
context.rotate(rotation);
context.scale(radius_a, radius_b);
context.arc(0, 0, 1, 0, 2* Math.PI, false);
context.restore();
context.stroke();

21 later thoughts