Draw an oval in html5 canvas

The JavaScript canvas element does not have a native method for drawing ovals (ellipses). There are several solutions available including drawing a circle with the arc() method and then distorting it with the scale() method. Two beizer curves can also be used to approximate an oval. However, for the tides illustration, I needed more control so I used a for loop to plot the points of an ellipse.

Plotting the ellipse, makes it easy to rotate the oval and to draw partial ovals. The canvas below show how much control over the size and orientation of the ellipse this approach provides. The code for the oval is given below the illustration.