Fork me on GitHub

Parametric plots

This is a demo page for a small javascript library used to animate parametric graphs using d3js. Read on for details, or click the banner to go straight to the github source.

You might draw a circle by plotting (cos(t), sin(t)) as t goes from 0 to 2π. That looks like this:

You can adjust the aspect ratio using the optional arguments "width" and "height":

You can make the drawer go four times faster using the optional argument "duration":

Using math, you might also just make the domain of t four times as long (0 to 8π), or parameterize by 4t:

The graph is auto centering, and makes sure to include the origin (this can be good or bad): Here is a graph centered at (200, 200), and the same graph centered at (0, 0):

Check out the source code to see how the graphs were generated or to grab the javascript. Uses d3.js.