This is merely a technical demo in JavaScript (take that as a hint if you do not see any graphs). It’s not meant to be fancy or even accurate (the way I compute the lengths of segments to fill some space is a bit dodgy and does not take into account the drawing area).

Clicking on the formulas takes you to http://wolframalpha.com/ for more details.