How to draw an ellipse with a pencil, a string, and two nails

I keep forgetting the formula, so here it is for posterity.

In PHP, it looks like this:
$foci = round (sqrt (pow ($major_axis, 2) - pow ($minor_axis, 2)) ,4);

And here's a form to prove it:

Major axis      
Minor axis      

Place nails 1.7321 units apart, string is 2 units long.

For a nice explanation of elliptical math and nomenclature, see