Equation Art Studio
Turn math into art: parametric, polar, Lissajous, rose and spirograph curves.
How it works
Type x(t) and y(t), or r(θ), or start from a preset (Lissajous, rose, spirograph, butterfly, heart), add rotational symmetry and a colour palette, and get a crisp SVG artwork plus a PNG download. Expressions are parsed safely (no code execution) and support + − × ÷ ^, sin, cos, tan, sqrt, abs, exp, log, pi and e.
- Expressions are tokenised and parsed by a small recursive-descent parser into a syntax tree, which is compiled into plain arithmetic closures — no eval or Function, and only the listed functions, constants and variables are accepted.
- Polar curves are converted with x = r(θ)·cos θ, y = r(θ)·sin θ. Presets: Lissajous x = sin(a·t + d), y = sin(b·t); rose r = cos(a/b·θ); spirograph (hypotrochoid) x = (a−b)cos t + c·cos((a−b)/b·t), y = (a−b)sin t − c·sin((a−b)/b·t); Temple Fay’s butterfly; the classic 16 sin³t heart. Roses and spirographs with whole-number a, b run exactly one full period: for a rose with a/b = p/q in lowest terms that is π·q when p·q is odd and 2π·q otherwise (7/3 closes at 3π); for a spirograph 2π·b/gcd(a, b).
- t is sampled evenly from start to end. Undefined samples (division by zero, sqrt of a negative number) leave gaps, and very large jumps (asymptotes) are not connected.
- The drawing is fitted into a 600 × 600 square with equal x/y scale, optionally rotated into k symmetric copies, and coloured along t with a gradient from the palette. Points closer than 0.3 px are dropped to keep the SVG small.
- The SVG uses only plain shapes (no scripts or styles). The PNG is rendered from the same SVG with ImageMagick when it is installed; both downloads stay available for about 2 hours.
Use this tool in an app
These free programs for your browser have this tool built in, next to everything else the task needs.
-
Proofline Math notebook
Solve, graph, test and visualise in one notebook — with data, findings and a report.
How to use the Equation Art Studio
Turn parametric, polar, rose and spirograph equations into colourful SVG and PNG artwork, and learn which parameters make a curve close neatly.
What it is for
A spirograph set, a maths lesson on polar coordinates, a poster, a laser-cut ornament or just procrastination with style: plenty of beautiful shapes come from a single line of maths. Graphing tools can plot them, but the result usually looks like homework.
The studio turns equations into finished artwork. Pick a preset (Lissajous figure, rose, spirograph, Temple Fay's butterfly, the classic heart) or type your own x(t) and y(t), or r(θ). Add rotational symmetry and a colour palette, and you get a clean SVG plus an optional PNG. Expressions are parsed by a small built-in parser, not executed as code. It supports + − × ÷ ^, sin, cos, tan, sqrt, abs, exp, log, pi and e, and implicit multiplication such as 2t or 3sin(t).
It is not a plotting calculator. There are no axes and no scale, because the drawing is always centred and fitted into a 600 × 600 square.
Worked example
Spirograph with a = 7, b = 4, c = 3, 2,000 samples and the sunset palette.
Result: Spirograph (hypotrochoid): 2,031 points drawn, a closed loop, t from 0 to 25.133.
Why 25.133? That is 8π. With whole numbers a and b, the studio runs the curve for exactly the length it needs to close: 2π × b ÷ gcd(a, b) = 2π × 4. The output was a 28 KB SVG and a 145 KB PNG, with no invalid samples.
Rose with a = 7, b = 3, three rotated copies and the ocean palette gave 4,593 points over t from 0 to 9.42 (3π). Because 7 × 3 is odd, the rose already closes after 3π, so the studio stops there instead of drawing every petal twice. Your own curve x = cos(t) + cos(6t)/2 + sin(14t)/3, y = sin(t) + sin(6t)/2 + cos(14t)/3 over 0 to 2π drew 2,526 points as a closed loop.
How to read the result
- Points drawn and closed — "a closed loop" means the end meets the start, so there is no visible seam. If it isn't closed, extend "t to".
- t range — the range actually used: your values or the preset's default.
- Invalid samples — points where the formula is undefined, such as division by zero or the square root of a negative number. They leave gaps on purpose, and lines are not drawn across asymptotes.
- Arc length and bounding box — the curve's size in its own units, useful when comparing variants.
- Downloads — the SVG (plain shapes, no scripts) and the PNG. Both links stay available for about two hours, so save the files you like.
Tips and common mistakes
- Use whole numbers for a and b on roses and spirographs. With fractions the curve may never close, and the studio falls back to a long default range.
- More samples make fast-changing curves smooth. Samples × symmetry copies is capped at 24,000, so lower the samples when you add copies.
- Symmetry works best with curves that aren't already symmetric. A 5-petal rose with 5 copies looks almost like the original.
- Angles are in radians.
sin(90)is not 1; writesin(pi/2). - Use the SVG for printing, cutting or embroidery software. It scales without blur, while the PNG is for quick sharing.
FAQ
How do I get the classic spirograph look?
Use the spirograph preset: a is the fixed ring, b the rolling wheel and c the pen distance from the wheel's centre. Try a = 7, b = 4, c = 3 first, then change c.
Why does my own formula show an error?
Only the listed functions, constants and variables (t, a, b, c, d) are accepted. Check for typos like sine or a missing bracket.
Can I write θ in polar formulas?
Yes. Write theta or t; both mean the angle.
Can I use the artwork commercially?
The tool doesn't add any licence or watermark to the files. The curves are mathematics, so check only your own palette and design choices.
Guide last updated:
For scripts and AI agents
- JSON API:
POST https://equationartstudio.usefulweb.site/api/v1/calculate(same calculation as this page) - Interface description: OpenAPI 3.1 · AI guide: llms.txt
- MCP server (Streamable HTTP):
https://equationartstudio.usefulweb.site/mcp· tool nameequation_art_studio
Example request
curl -s -X POST https://equationartstudio.usefulweb.site/api/v1/calculate \
-H 'content-type: application/json' \
-d '{"curve":"spirograph","a":7,"b":4,"c":3,"samples":2000,"symmetry":1,"palette":"sunset","strokeWidth":2}'