Back

Math Curve Loaders

Rose Curve

Petal-shaped polar curve

r = cos(kθ)

Inspired by math-curve-loaders by @xin_pai88825

Component Code (Next.js)

Use Copy Code to load the current local source for the Math Curve Loaders component.

Claude / Codex Prompt

Build a Math Curve Loaders gallery component in Next.js with animated canvas-based loading animations based on mathematical curves.

Requirements:
- Display 6 mathematical curve loaders: Rose Curve, Lissajous, Hypotrochoid, Cardioid, Cassini Oval, and Fourier Path
- Each loader is drawn on an HTML Canvas using requestAnimationFrame for smooth 60fps animation
- Particles trail along the mathematical curve path with fading opacity for a glowing trail effect
- Include a pill-bar selector to switch between curve types
- Show the active curve's mathematical formula and description
- The selected curve animates in a large canvas preview area
- Show all curves in a small grid below for quick comparison
- Use distinct colors per curve: purple for Rose, pink for Lissajous, green for Hypotrochoid, orange for Cardioid, blue for Cassini, violet for Fourier
- Device pixel ratio aware canvas rendering for crisp output
- Credit: https://x.com/xin_pai88825?s=21
- Inspired by: https://github.com/paidax01/math-curve-loaders