Fun & games

Equation Art Studio

Turn math into art: parametric, polar, Lissajous, rose and spirograph curves.

Used for “my own parametric curve”. Variables: t, a, b, c, d. Implicit multiplication works: 2t, 3sin(t).

Used for “my own polar curve”. Write θ as theta or t.

A number or constant expression such as 0 or -pi. Empty = preset default (0).

E.g. 2*pi. Empty = preset default (2π, or a full period for roses and spirographs).

Parameter for presets and your expressions. Empty = preset default.

More samples = smoother curves. Samples × symmetry copies is limited to 24,000.

px

Try an example: Spirograph, sunset palette · Rose with 3-fold symmetry · Own parametric curve

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.
  • 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.

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 name equation_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}'
Feedback