Five curves that draw themselves
Every curve on this page is a string of about two hundred pairs of numbers, and every one of those numbers was printed by a script into this site's stylesheet. There is no drawing here in the sense of a program deciding what to draw as you watch. The curve was already drawn when you opened the page. What you are watching is a line uncovering itself, which is a much older trick and, I think, a better one.
Two CSS properties do all the work and neither of them knows what a curve is. The first is a dash pattern: give a stroke a dash array as long as the whole path and an offset as long as the whole path, and you have made the stroke invisible. Then animate the offset to zero and the stroke appears to be drawn, tip first, at exactly the speed you asked for. It is how dashes work, pointed the other way.
The second is offset-path, which lets an ordinary element be pinned to a path. The small gold dot on each figure is not a circle travelling along a curve. It is a circle that a stylesheet has been told where to be at each moment, the same way the stroke was told where its tip was.
Here is the price of the trick, and it is worth stating. The curve lives in two places at once: once as SVG path data, so a stroke can draw it, and once as CSS path data, so a dot can ride it. CSS has no way to say "the path with that id" and borrow it. So the string is written twice, and I pay for it in bytes rather than in cleverness. The duplication is generated, not typed, which is the only reason I let it exist.
x = sin 3t, y = sin 2t, 220 points, 1345 units of path, closes.x = sin 5t, y = sin 4t, 220 points, 2393 units of path, closes.x = e^-0.14t sin 3t, y = e^-0.14t sin 2t, 220 points, 1501 units of path, spirals in, never closes.x = 2cos t + 5cos(2t/3), y = 2sin t - 5sin(2t/3), 220 points, 904 units of path, closes after three turns of t.x = 9t, y = 5.562t, 220 points, 207 units of path, open, it just leaves.Five figures, five dash cycles, 9 to 18 seconds each. The faint line is the curve that has already been drawn; the bright line is the one being drawn right now. Three of the five close exactly on themselves (endpoint gap 0.00, checked); the harmonograph spirals inward and the spiral walks off the edge, which is what those two are for.
What the five are
The two Lissajous figures are the plainest case: one sine against another, with whole-number ratios. Three to two closes into a pretzel, five to four into a knot with more crossings than anyone expects. Any two whole numbers make one of these, and the whole family is the reason the ratio matters more than the amplitude.
The harmonograph is what you get when two pendulums of slightly different length swing on the same table with a pen between them, which is why every one of them ever built draws a different picture and none of them draws the same picture twice. A damping term shrinks the swing, so the curve spirals into a point instead of closing.
The hypotrochoid is the spirograph maths: a circle rolling inside a circle five times the size, with a pen five units out from the rolling circle's centre. It closes after three turns of its parameter and draws three cusps and three arches. The spiral is the plainest of the five and the fastest to read: a constant rate of turn, opening forever.
One thing all five share. The path data is printed from the formula by tools/lab-curves.py, which also prints the path length used for the dash array. If the length were too short the drawing would stop short, and if it were wrong the animation would still look fine, which is exactly the kind of bug that hides. So the number is computed rather than guessed.