Open all the folds
Close all the folds
Definitions, derivations, notes, and long tables start folded.
Chapter 4 A gallery of programs
The first eight are Splat Equation's own programs; the rest are small ideas to copy and
change. Each button opens the Splash with that program; then tap it to play t .
While the Splash is being tried out, it is on the shelf only when Splashery is opened with
?labs=1, but these links always open it.
Sphere
A sphere from two angles, u around and v from pole to pole, spinning with u + t. Six
stripes from floor(6u/(2pi)).
x = sin(v)cos(u + t)
y = cos(v)
z = sin(v)sin(u + t)
u = 0 .. 2pi
v = 0 .. pi
hue = floor(6u/(2pi))/6 + 0.04
size = 0.035
count = 7000
Open it in Splat Equation
Torus
A tube around a ring. v + t rolls the tube around itself, so it turns inside out as
you watch.
x = (2 + cos(v + t))cos(u)
y = sin(v + t)
z = (2 + cos(v + t))sin(u)
u = 0 .. 2pi
v = 0 .. 2pi
hue = v/(2pi)
size = 0.09
count = 6000
Open it in Splat Equation
Möbius strip
A band with a half twist: cos(u/2) turns the band over once as u goes around. The
colors flow along it.
x = (1 + v cos((u + t)/2))cos(u + t)
y = v sin((u + t)/2)
z = (1 + v cos((u + t)/2))sin(u + t)
u = 0 .. 2pi
v = -0.4 .. 0.4
hue = u/(2pi)
size = 0.035
count = 4000
Open it in Splat Equation
Seashell
A tube that grows by exp(0.1u) as it winds three times around, turning with u + t. Its
splats grow too.
x = exp(0.1u)cos(u + t)(1.2 + cos v)
y = exp(0.1u)(sin(v) - 2.4) + 3
z = exp(0.1u)sin(u + t)(1.2 + cos v)
u = 0 .. 6pi
v = 0 .. 2pi
hue = 0.02 + 0.1u/(6pi) + 0.03cos(4u)
size = 0.14exp(0.1u)
count = 10000
Open it in Splat Equation
Trefoil knot
The simplest real knot, a curve in u alone, turned about the vertical by the rotation
formulas in t.
x = (sin(u) + 2sin(2u))cos(t) - sin(3u)sin(t)
y = cos(u) - 2cos(2u)
z = -(sin(u) + 2sin(2u))sin(t) - sin(3u)cos(t)
u = 0 .. 2pi
v = 0 .. 1
hue = u/(2pi)
size = 0.16
count = 2500
Open it in Splat Equation
Wave
A flat sheet in u and v with ripples running out from the middle: sin(distance − t).
x = u
y = 0.45sin(2sqrt(u^2 + v^2) - t)
z = v
u = -3 .. 3
v = -3 .. 3
hue = 0.58 - 0.07sin(2sqrt(u^2 + v^2) - t)
size = 0.07
count = 6000
Open it in Splat Equation
Spiral galaxy
Two arms from floor(v) (0 or 1, half a turn apart), scattered at random, turning once.
Colors from r, g, and b.
x = u^1.5 cos(pi floor(v) + 5u + 1.2(v - floor(v)) - t)
y = 0.06(1 - u)sin(91v + 37u)
z = u^1.5 sin(pi floor(v) + 5u + 1.2(v - floor(v)) - t)
u = 0.02 .. 1
v = 0 .. 2
r = 0.55 + 0.45(1 - u)^2
g = 0.62 + 0.33(1 - u)^2
b = 1 - 0.45(1 - u)^3
size = 0.006 + 0.012(1 - u)^2
count = 10000
spread = random
Open it in Splat Equation
Klein bottle (figure eight)
The figure-eight Klein bottle: a figure-eight tube around a ring, with a half twist,
so it has no inside or outside.
x = (2 + cos(u/2)sin(v + t) - sin(u/2)sin(2v + 2t))cos(u)
y = sin(u/2)sin(v + t) + cos(u/2)sin(2v + 2t)
z = (2 + cos(u/2)sin(v + t) - sin(u/2)sin(2v + 2t))sin(u)
u = 0 .. 2pi
v = 0 .. 2pi
hue = v/(2pi)
size = 0.13
count = 8000
Open it in Splat Equation
Hello, circle
The smallest program: one loop of u makes a ring of 200 splats. No v, no t.
x = cos(u)
y = sin(u)
z = 0
u = 0 .. 2pi
hue = u/(2pi)
size = 0.06
count = 200
Open it in Splat Equation
Bouncing spring
Three turns of a helix whose height breathes with sin(t).
x = cos(u)
y = (0.09 + 0.035sin(t))u - 0.9
z = sin(u)
u = 0 .. 6pi
hue = 0.08 + u/(6pi)/3
size = 0.07
count = 1500
Open it in Splat Equation
Beating heart
A famous heart curve, filled in by v from the middle out, beating twice per cycle.
x = v(1 + 0.08sin(2t))16sin(u)^3
y = v(1 + 0.08sin(2t))(13cos(u) - 5cos(2u) - 2cos(3u) - cos(4u))
z = 0
u = 0 .. 2pi
v = 0 .. 1
hue = 0.97 + 0.04v
size = 0.35
count = 4000
Open it in Splat Equation
Rainbow ribbon
Color from r, g, and b: three cosines about a third of a turn apart make a rainbow
along u.
x = u
y = 0.4sin(2u - t)
z = v
u = -3 .. 3
v = -0.4 .. 0.4
r = 0.5 + 0.5cos(u)
g = 0.5 + 0.5cos(u - 2)
b = 0.5 + 0.5cos(u + 2)
size = 0.05
count = 4000
Open it in Splat Equation
Firework
Splats scattered at random over a sphere (v is the height, from −1 to 1) fly out,
droop, and come back.
x = (0.2 + sin(t/2))sqrt(1 - v^2)cos(u)
y = (0.2 + sin(t/2))v - 0.35sin(t/2)^2
z = (0.2 + sin(t/2))sqrt(1 - v^2)sin(u)
u = 0 .. 2pi
v = -1 .. 1
hue = u/(2pi)
size = 0.018
count = 3000
spread = random
Open it in Splat Equation
Opening flower
Five petals from cos(5u), and a cup that opens and closes with sin(t/2).
x = v(0.6 + 0.4cos(5u))cos(u)
y = (0.15 + 0.6sin(t/2))v^2
z = v(0.6 + 0.4cos(5u))sin(u)
u = 0 .. 2pi
v = 0 .. 1
hue = 0.92 - 0.12v
size = 0.035
count = 5000
Open it in Splat Equation
Vase (no t)
A shape without t stands still, so a tap draws its splats again one by one, in the
order they are made.
x = (0.5 + 0.2sin(3v))cos(u)
y = v
z = (0.5 + 0.2sin(3v))sin(u)
u = 0 .. 2pi
v = 0 .. 2.2
hue = 0.55 + 0.05sin(12u)
size = 0.045
count = 4000
Open it in Splat Equation
Sixty more programs
A second gallery, in six groups of ten. Each program reads, builds, and looks like its
title. A few are honest look-alikes or samples of a named system, and say so; none is a full
solution of the system it names. Each card has the picture, one line about the shape, the
program (folded), and a Run it link that opens the Splat Equation Splash with that
program, in a new tab. That Splash is a labs Splash: it is not on the ordinary shelf,
but a direct link like these opens it even with labs off, and its sharper kernel setting
needs labs turned on. Every program fits the Splash's own limits: 12 fields, 240 characters
to an expression (each end of a range counts on its own; these programs are all under 120),
and at most 10,000 points.
Classic surfaces (10 programs)
Spun sphere
A sphere turns once around its vertical axis, and its hue runs around the axis (by
longitude), so the colors turn with it.
Show the program
x = sin(v)cos(u+t)
y = cos(v)
z = sin(v)sin(u+t)
u = 0 .. 2pi
v = 0 .. pi
hue = u/(2pi)
size = 0.04
count = 6000
Run it
(a labs Splash)
About the shape
Rainbow torus
A round tube wraps around a ring as its colors follow the small circle.
Show the program
x = (2+0.55cos(v))cos(u)
y = 0.55sin(v)
z = (2+0.55cos(v))sin(u)
u = 0 .. 2pi
v = 0 .. 2pi
hue = v/(2pi)
size = 0.05
count = 7000
Run it
(a labs Splash)
About the shape
Möbius ribbon
A narrow band turns through one half twist before its edges meet.
Show the program
x = (1+vcos(u/2))cos(u)
y = vsin(u/2)
z = (1+vcos(u/2))sin(u)
u = 0 .. 2pi
v = -0.32 .. 0.32
hue = u/(2pi)
size = 0.035
count = 5000
Run it
(a labs Splash)
About the shape
Figure-eight Klein bottle
This immersed Klein bottle is a figure-eight tube that crosses itself along a ring.
Show the program
x = (2+cos(u/2)sin(v)-sin(u/2)sin(2v))cos(u)
y = sin(u/2)sin(v)+cos(u/2)sin(2v)
z = (2+cos(u/2)sin(v)-sin(u/2)sin(2v))sin(u)
u = 0 .. 2pi
v = 0 .. 2pi
hue = v/(2pi)
size = 0.07
count = 10000
Run it
(a labs Splash)
About the shape
Pseudosphere
Two tractrix horns meet at a sharp rim: a surface that curves the opposite way from
a sphere.
Show the program
x = cos(u)/cosh(v)
y = 1.2(v-tanh(v))
z = sin(u)/cosh(v)
u = 0 .. 2pi
v = -2.6 .. 2.6
hue = 0.55+0.2v/2.6
size = 0.05
count = 10000
Run it
(a labs Splash)
About the shape
Enneper surface
A simple polynomial surface curls into spreading lobes.
Show the program
x = u-u^3/3+uv^2
y = v-v^3/3+vu^2
z = u^2-v^2
u = -1.6 .. 1.6
v = -1.6 .. 1.6
hue = 0.55+0.1sin(4u)
size = 0.07
count = 10000
Run it
(a labs Splash)
About the shape
Catenoid
A catenoid pinches between two wide circular rims.
Show the program
x = 0.45cosh(v)cos(u)
y = 0.45v
z = 0.45cosh(v)sin(u)
u = 0 .. 2pi
v = -1.6 .. 1.6
hue = 0.55+0.1v
size = 0.035
count = 7000
Run it
(a labs Splash)
About the shape
Helicoid
A finite ruled helicoid patch winds like a ramp around the Z axis, with a helical
edge on its outer rim.
Show the program
x = vcos(u)
y = vsin(u)
z = 0.18u
u = -3pi .. 3pi
v = -1 .. 1
hue = 0.55+0.12sin(u)
size = 0.035
count = 7000
Run it
(a labs Splash)
About the shape
Dini surface
Dini’s surface twists a trumpet shape into a tight spiral.
Show the program
x = 0.65cos(u)sin(v)
y = 0.65sin(u)sin(v)
z = 0.65(cos(v)+log(tan(v/2)))+0.12u
u = 0 .. 4pi
v = 0.18 .. 2.95
hue = u/(4pi)
size = 0.03
count = 8000
Run it
(a labs Splash)
About the shape
Shell growth
A logarithmic tube grows wider as it winds away from its narrow tip.
Show the program
x = exp(0.12u)(1+0.35cos(v))cos(u)
y = exp(0.12u)(1+0.35cos(v))sin(u)
z = exp(0.12u)(0.35sin(v))
u = 0 .. 6pi
v = 0 .. 2pi
hue = u/(6pi)
size = 0.04+0.01u
count = 10000
Run it
(a labs Splash)
About the shape
Curves as tubes or beads (10 programs)
Lissajous curve
Four frequencies (2, 3, 4, and 7) trace a closed space curve that crosses itself,
with a fine bead tube.
Show the program
x = sin(3u+t)+0.16cos(7u)
y = 0.12cos(2u)
z = cos(4u+t)+0.16sin(7u)
u = 0 .. 2pi
v = 0 .. 1
hue = u/(2pi)
size = 0.045
count = 3200
Run it
(a labs Splash)
About the shape
Trefoil tube
A tube follows the classic three-crossing trefoil knot and rotates in place.
Show the program
x = (sin(u)+2sin(2u))cos(t)-sin(3u)sin(t)
y = cos(u)-2cos(2u)
z = -(sin(u)+2sin(2u))sin(t)-sin(3u)cos(t)
u = 0 .. 2pi
v = 0 .. 1
hue = u/(2pi)
size = 0.08
count = 3000
Run it
(a labs Splash)
About the shape
Cinquefoil knot
Five over-and-under crossings wind around a torus in this thicker knot.
Show the program
x = (2+0.35cos(5u))cos(2u+t)
y = 0.35sin(5u)
z = (2+0.35cos(5u))sin(2u+t)
u = 0 .. 2pi
v = 0 .. 1
hue = u/(2pi)
size = 0.055
count = 3500
Run it
(a labs Splash)
About the shape
Rose curve beads
The curve cos(6u) traced in a plane makes a rose of 12 petals (an even multiple
makes twice as many), and a gentle vertical wave lifts it into a dotted
three-dimensional curve.
Show the program
x = cos(6u)cos(u)
y = 0.15sin(3u)
z = cos(6u)sin(u)
u = 0 .. 2pi
v = 0 .. 1
hue = u/(2pi)
size = 0.04
count = 3000
Run it
(a labs Splash)
About the shape
Trefoil knot beads
This closed string of beads traces a trefoil, the simplest knot (a torus knot that
wraps three times one way and twice the other).
Show the program
x = (2+cos(2u))cos(3u+t)
y = sin(2u)
z = (2+cos(2u))sin(3u+t)
u = 0 .. 2pi
v = 0 .. 1
hue = u/(2pi)
size = 0.05
count = 3500
Run it
(a labs Splash)
About the shape
Double helix
Two spiral strands wind together around a long axis.
Show the program
x = 1.1cos(3u+pi floor(2v))
y = 1.4(u/pi-1)
z = 1.1sin(3u+pi floor(2v))
u = 0 .. 2pi
v = 0 .. 1
hue = 0.02+0.3floor(2v)+0.1u/(2pi)
size = 0.09
count = 10000
spread = random
Run it
(a labs Splash)
About the shape
Slinky coil
A spring winds upward in eight turns as a narrow ribbon.
Show the program
x = (1+0.08v)cos(u)
y = 0.1u+0.08vcos(u/8)
z = (1+0.08v)sin(u)
u = 0 .. 16pi
v = -1 .. 1
hue = u/(16pi)
size = 0.035
count = 5000
Run it
(a labs Splash)
About the shape
Lorenz-like look-alike
This butterfly loop is a Lorenz-like look-alike, not a Lorenz-system solution.
Show the program
x = 2.4sin(u)
y = 1.5sin(2u)+0.25sin(6u)
z = 1.1cos(u)+0.3cos(3u)
u = 0 .. 2pi
v = 0 .. 1
hue = u/(2pi)
size = 0.07
count = 4000
Run it
(a labs Splash)
Rössler-like look-alike
A looping spiral suggests a Rössler attractor but is only a parametric look-alike.
Show the program
x = cos(u)+0.35cos(7u)
y = sin(u)+0.35sin(7u)
z = 0.45sin(3u)
u = 0 .. 2pi
v = 0 .. 1
hue = u/(2pi)
size = 0.045
count = 3000
Run it
(a labs Splash)
Five-petal flower
Five broad petals rise from a shallow cup around a small center.
Show the program
x = v(0.55+0.45cos(5u))cos(u)
y = 0.5v^2+0.1cos(5u)
z = v(0.55+0.45cos(5u))sin(u)
u = 0 .. 2pi
v = 0 .. 1
hue = 0.9-0.12v
size = 0.035
count = 6000
Run it
(a labs Splash)
About the shape
Nature-like shapes (10 programs)
Sunflower-style spiral
A face-on disk shades from dark seeds to a golden rim, with Fibonacci-style spiral
arms drawn in the color.
Show the program
x = 1.8sqrt(u)cos(2pi v)
y = 1.8sqrt(u)sin(2pi v)
z = 0.25(1-u)
u = 0.002 .. 1
v = 0 .. 1
r = 0.3+0.7sqrt(u)(0.75+0.25sin(26pi v-24sqrt(u)))
g = 0.15+0.6sqrt(u)(0.75+0.25sin(26pi v-24sqrt(u)))
b = 0.02+0.1u
size = 0.04
count = 10000
Run it
(a labs Splash)
About the shape
Nautilus coil
A widening spiral tube evokes a nautilus shell with a visible open center.
Show the program
x = exp(0.13u)(1+0.3cos(v))cos(u)
y = 0.3exp(0.13u)sin(v)
z = exp(0.13u)(1+0.3cos(v))sin(u)
u = 0 .. 5pi
v = 0 .. 2pi
hue = 0.04+0.12u/(5pi)
size = 0.035+0.008u
count = 10000
Run it
(a labs Splash)
About the shape
Jellyfish bell
A dome-like bell pulses as its rim widens and narrows once each cycle.
Show the program
x = (0.9+0.12sin(t))sin(v)(1+0.1cos(8u)sin(v)^6)cos(u)
y = 0.9cos(v)-0.2
z = (0.9+0.12sin(t))sin(v)(1+0.1cos(8u)sin(v)^6)sin(u)
u = 0 .. 2pi
v = 0 .. 0.6pi
hue = 0.82+0.05cos(8u)-0.1v
size = 0.05
count = 10000
Run it
(a labs Splash)
About the shape
Coral fan
Branching sine ribs spread across a fan-shaped sheet.
Show the program
x = vcos(u)
y = 0.16sin(9u+2v)
z = vsin(u)
u = -1.3 .. 1.3
v = 0 .. 1.8
hue = 0.03+0.08sin(9u+2v)
size = 0.025
count = 7000
Run it
(a labs Splash)
About the shape
Pinecone spiral
Scales follow a Fibonacci angle and taper toward the top of the cone.
Show the program
x = (0.9-0.65v)(1+0.09sin(16pi u+25v)sin(26pi u-25v))cos(2pi u+2.4v)
y = 1.8v
z = (0.9-0.65v)(1+0.09sin(16pi u+25v)sin(26pi u-25v))sin(2pi u+2.4v)
u = 0 .. 1
v = 0 .. 1
hue = 0.07+0.05v+0.025sin(16pi u+25v)sin(26pi u-25v)
size = 0.045
count = 10000
Run it
(a labs Splash)
About the shape
Sea anemone
Curled arms rise from a low base like a ring of waving tentacles.
Show the program
x = (0.25+0.55v)cos(u+0.3sin(3u))
y = v(1+0.18sin(5u))
z = (0.25+0.55v)sin(u+0.3sin(3u))
u = 0 .. 2pi
v = 0 .. 1
hue = 0.82+0.08sin(5u)
size = 0.03
count = 6000
Run it
(a labs Splash)
About the shape
Fern frond
A central stem and repeated leaflets make a simple fern-like frond.
Show the program
x = u
y = 0.08sin(7piu)
z = v(0.15+0.65abs(sin(7piu)))
u = -1 .. 1
v = 0 .. 1
hue = 0.28+0.12v
size = 0.025
count = 6500
Run it
(a labs Splash)
About the shape
Dahlia bloom
Layered radial petals alternate in height to form a dense dahlia-like flower.
Show the program
x = v(0.4+0.6abs(cos(12u)))cos(u)
y = 0.25sin(12u)*v
z = v(0.4+0.6abs(cos(12u)))sin(u)
u = 0 .. 2pi
v = 0 .. 1
hue = 0.88+0.1cos(12u)
size = 0.025
count = 8000
Run it
(a labs Splash)
About the shape
Sea fan branches
A flat branching fan uses nested waves to suggest coral growth.
Show the program
x = vcos(u)
y = 0.12sin(11u)
z = vsin(u)
u = -1.5 .. 1.5
v = 0 .. 1.5
hue = 0.48+0.1sin(11u)
size = 0.028
count = 6500
Run it
(a labs Splash)
About the shape
Lily pad
A scalloped circular leaf floats on a softly raised surface.
Show the program
x = v(1+0.04cos(24u))cos(u)
y = 0.3v^3+0.12v
z = v(1+0.04cos(24u))sin(u)
u = 0.3 .. 2pi
v = 0 .. 1.2
hue = 0.3+0.04cos(14u)-0.05v
size = 0.06
count = 10000
Run it
(a labs Splash)
About the shape
Things in motion (10 programs)
Traveling wave
Concentric ripples travel across a square sheet without breaking at the cycle seam.
Show the program
x = u
y = 0.38sin(2sqrt(u^2+v^2)-t)
z = v
u = -2.8 .. 2.8
v = -2.8 .. 2.8
hue = 0.58-0.08sin(2sqrt(u^2+v^2)-t)
size = 0.09
count = 10000
Run it
(a labs Splash)
About the shape
Breathing torus
The major and minor radii expand together and return once per cycle.
Show the program
x = (1.7+0.45cos(v))(1+0.12sin(t))cos(u)
y = 0.45(1+0.12sin(t))sin(v)
z = (1.7+0.45cos(v))(1+0.12sin(t))sin(u)
u = 0 .. 2pi
v = 0 .. 2pi
hue = v/(2pi)
size = 0.045
count = 6500
Run it
(a labs Splash)
About the shape
Rotating saddle
A saddle ripple rotates smoothly over a square patch.
Show the program
x = u
y = 0.22(u^2-v^2)cos(t)+0.2uvsin(t)
z = v
u = -1.6 .. 1.6
v = -1.6 .. 1.6
hue = 0.6+1.2(0.22(u^2-v^2)cos(t)+0.2uvsin(t))
size = 0.06
count = 10000
Run it
(a labs Splash)
About the shape
Orbit with a fast wave
One loop circles the center while a smaller wave on it, with three times as many
crests around the loop, turns the other way.
Show the program
x = cos(u+t)+0.35cos(3u-t)
y = 0.35sin(3u-t)
z = sin(u+t)
u = 0 .. 2pi
v = 0 .. 1
hue = u/(2pi)
size = 0.045
count = 4500
Run it
(a labs Splash)
About the shape
Opening flower
Petals lift and flatten in a smooth repeating bloom.
Show the program
x = v(0.55+0.45cos(5u))cos(u)
y = (0.12+0.45(1+sin(t))/2)v^2
z = v(0.55+0.45cos(5u))sin(u)
u = 0 .. 2pi
v = 0 .. 1
hue = 0.9-0.1v
size = 0.03
count = 6000
Run it
(a labs Splash)
About the shape
Breathing bumpy sphere
Four-fold bumps grow and shrink across a round surface as its color follows each
bump.
Show the program
x = sin(v)cos(u)(1+0.2cos(4u)cos(4v)sin(t+1.2))
y = cos(v)(1+0.2cos(4u)cos(4v)sin(t+1.2))
z = sin(v)sin(u)(1+0.2cos(4u)cos(4v)sin(t+1.2))
u = 0 .. 2pi
v = 0 .. pi
hue = 0.6+0.5cos(4u)cos(4v)sin(t+1.2)
size = 0.05
count = 10000
Run it
(a labs Splash)
About the shape
Twisting ribbon
A narrow ribbon rotates its cross-section through one full turn each cycle.
Show the program
x = u
y = 1.1vcos(2u+t)
z = 1.1vsin(2u+t)
u = -2.4 .. 2.4
v = -1 .. 1
hue = 0.5+0.25v+0.1u
size = 0.06
count = 10000
Run it
(a labs Splash)
About the shape
Pulsing star
Five radial points breathe in and out with the beat of a sine wave.
Show the program
x = 1.8v(0.65+0.16sin(t))(0.45+0.55(1-abs(sin(2.5u))))cos(u)
y = 1.8v(0.65+0.16sin(t))(0.45+0.55(1-abs(sin(2.5u))))sin(u)
z = 0.3(1-v)
u = 0 .. 2pi
v = 0 .. 1
hue = 0.1+0.08v+0.04sin(t)
size = 0.05
count = 10000
Run it
(a labs Splash)
About the shape
Wobbling helix
A helix sways side to side and returns to its starting pose each cycle.
Show the program
x = cos(u+t)
y = 0.12u
z = sin(u+t)+0.2sin(t)
u = 0 .. 8pi
v = 0 .. 1
hue = u/(8pi)
size = 0.04
count = 5000
Run it
(a labs Splash)
About the shape
Standing wave
A rectangular sheet ripples in place with a standing two-axis wave.
Show the program
x = u
y = 0.35sin(2u)sin(2v)cos(t)
z = v
u = -2 .. 2
v = -2 .. 2
hue = 0.62+0.12sin(2u)sin(2v)
size = 0.065
count = 10000
Run it
(a labs Splash)
About the shape
Color play (10 programs)
Height hue bands
A ridged surface assigns a full rainbow cycle to its height.
Show the program
x = u
y = 0.3sin(4u+3v)
z = v
u = -2 .. 2
v = -2 .. 2
hue = (sin(4u+3v)+1)/2
size = 0.04
count = 6000
Run it
(a labs Splash)
About the shape
Angle around the torus
Hue runs once around the large ring, so each slice across the tube has one color.
Show the program
x = (1.5+0.4cos(v))cos(u)
y = 0.4sin(v)
z = (1.5+0.4cos(v))sin(u)
u = 0 .. 2pi
v = 0 .. 2pi
hue = u/(2pi)
size = 0.04
count = 6500
Run it
(a labs Splash)
About the shape
Curvature-like bands
Nested sine ridges color a saddle with a pattern that suggests changing curvature.
Show the program
x = u
y = 0.15(u^2-v^2)
z = v
u = -2 .. 2
v = -2 .. 2
hue = 0.5+0.2sin(3u)cos(3v)
size = 0.035
count = 6500
Run it
(a labs Splash)
About the shape
RGB sunset gradient
Red rises with height, green follows the horizontal angle, and blue fills the
valleys.
Show the program
x = cos(u)(1+0.2v)
y = v
z = sin(u)(1+0.2v)
u = 0 .. 2pi
v = -1 .. 1
r = 0.55+0.35v
g = 0.5+0.4sin(u)
b = 0.55-0.3v
size = 0.04
count = 6000
Run it
(a labs Splash)
About the shape
Rainbow shell
A growing shell carries a rainbow gradient from its narrow tip to its wide lip.
Show the program
x = exp(0.1u)cos(u)(1+0.25cos(v))
y = exp(0.1u)0.25sin(v)
z = exp(0.1u)sin(u)(1+0.25cos(v))
u = 0 .. 6pi
v = 0 .. 2pi
hue = u/(6pi)
size = 0.04+0.01u
count = 10000
Run it
(a labs Splash)
About the shape
Blue-green sphere
An RGB gradient moves from deep blue at the bottom to green at the top.
Show the program
x = sin(v)cos(u)
y = cos(v)
z = sin(v)sin(u)
u = 0 .. 2pi
v = 0 .. pi
r = 0.05
g = 0.1+0.85(1+cos(v))/2
b = 0.15+0.8(1-cos(v))/2
size = 0.05
count = 10000
Run it
(a labs Splash)
About the shape
Klein bottle color flow
Alternating bands run around the immersed bottle and make its crossing easy to see.
Show the program
x = (2+cos(u/2)sin(v)-sin(u/2)sin(2v))cos(u)
y = sin(u/2)sin(v)+cos(u/2)sin(2v)
z = (2+cos(u/2)sin(v)-sin(u/2)sin(2v))sin(u)
u = 0 .. 2pi
v = 0 .. 2pi
hue = 0.5+0.25sin(4v)
size = 0.07
count = 10000
Run it
(a labs Splash)
About the shape
Plasma RGB sheet
Three offset waves make a smooth red, green, and blue color field.
Show the program
x = u
y = 0.15sin(1.5u+1.5v)
z = v
u = -3 .. 3
v = -3 .. 3
r = 0.5+0.45sin(1.5u)
g = 0.5+0.45sin(1.5v+2)
b = 0.5+0.45sin(1.5u+1.5v+4)
size = 0.09
count = 10000
Run it
(a labs Splash)
About the shape
Longitude stripes
A sphere is divided into twelve clean color wedges by its longitude.
Show the program
x = sin(v)cos(u)
y = cos(v)
z = sin(v)sin(u)
u = 0 .. 2pi
v = 0 .. pi
hue = floor(12u/(2pi))/12
size = 0.035
count = 7000
Run it
(a labs Splash)
About the shape
Rainbow wave
A moving ripple shifts both the sheet height and its rainbow colors.
Show the program
x = u
y = 0.35sin(2u+v-t)
z = v
u = -3 .. 3
v = -3 .. 3
hue = 0.5+0.2sin(2u+v-t)
size = 0.04
count = 7000
Run it
(a labs Splash)
About the shape
Math showpieces (10 programs)
Thermal spiral
Warm colors gather near the core and cool colors trail along the spiral arms.
Show the program
x = u cos(v+5u)
y = 0.12sin(13v+4u)
z = u sin(v+5u)
u = 0.02 .. 1
v = 0 .. 2
hue = 0.02+0.55u
size = 0.018
count = 9000
spread = random
Run it
(a labs Splash)
About the shape
Hopf link
Two circles pass through each other once, the simplest link, drawn as two dotted
rings in different colors.
Show the program
x = 1.6(1-floor(2v))cos(u)+floor(2v)(1.6cos(u)+1.6)-0.8
y = 1.6(1-floor(2v))sin(u)
z = 1.6floor(2v)sin(u)
u = 0 .. 2pi
v = 0 .. 1
hue = 0.02+0.55floor(2v)+0.1u/(2pi)
size = 0.14
count = 10000
spread = random
Run it
(a labs Splash)
About the shape
Fourier epicycle curve
Three rotating harmonics add into one closed curve with a small bead radius.
Show the program
x = cos(u)+0.45cos(3u)+0.2cos(5u)
y = 0.18sin(7u)
z = sin(u)+0.45sin(3u)+0.2sin(5u)
u = 0 .. 2pi
v = 0 .. 1
hue = u/(2pi)
size = 0.04
count = 3500
Run it
(a labs Splash)
About the shape
Superquadric
Fourth-power rounding turns a sphere into a soft box with six flattened faces.
Show the program
x = 1.6cos(u)cos(v)/((cos(u)^4+sin(u)^4)^0.25(cos(v)^4+sin(v)^4)^0.25)
y = 1.6sin(v)/(cos(v)^4+sin(v)^4)^0.25
z = 1.6sin(u)cos(v)/((cos(u)^4+sin(u)^4)^0.25(cos(v)^4+sin(v)^4)^0.25)
u = 0 .. 2pi
v = -pi/2 .. pi/2
hue = 0.5+0.3v/pi+0.1sin(u)
size = 0.06
count = 10000
Run it
(a labs Splash)
About the shape
Riemann branch look
A square-root branch surface spirals through two sheets around its branch point.
Show the program
x = sqrt(u)cos(v/2)
y = sqrt(u)sin(v/2)
z = 0.12v
u = 0.03 .. 1
v = 0 .. 4pi
hue = v/(4pi)
size = 0.03
count = 7000
Run it
(a labs Splash)
About the shape
Monkey saddle
A cubic height field has three valleys meeting at one central saddle point.
Show the program
x = u
y = 0.12(u^3-3uv^2)
z = v
u = -1.2 .. 1.2
v = -1.2 .. 1.2
hue = 0.55+0.1sin(3u)+0.2(u^3-3uv^2)
size = 0.05
count = 10000
Run it
(a labs Splash)
About the shape
Spherical harmonic lobes
A spherical-harmonic-like radial formula gives the sphere four raised and lowered
lobes.
Show the program
x = (1+0.3sin(v)^2cos(4u))sin(v)cos(u)
y = (1+0.3sin(v)^2cos(4u))cos(v)
z = (1+0.3sin(v)^2cos(4u))sin(v)sin(u)
u = 0 .. 2pi
v = 0 .. pi
hue = 0.55+0.15cos(4u)
size = 0.035
count = 7000
Run it
(a labs Splash)
About the shape
Lemniscate tube
A tube wraps around a sideways figure eight with a subtle vertical wave.
Show the program
x = cos(u)/(1+sin(u)^2)
y = 0.16sin(3u)
z = sin(u)cos(u)/(1+sin(u)^2)
u = 0 .. 2pi
v = 0 .. 1
hue = u/(2pi)
size = 0.05
count = 3000
Run it
(a labs Splash)
About the shape
Gyroid slice
A height graph of one slice of the gyroid function rises and falls in a repeating
pattern of hills and valleys.
Show the program
x = u
y = 0.5(sin(u)cos(v)+0.36sin(v)+0.93cos(u))
z = v
u = -1.5pi .. 1.5pi
v = -1.5pi .. 1.5pi
hue = 0.55+0.3(sin(u)cos(v)+0.36sin(v)+0.93cos(u))
size = 0.11
count = 10000
Run it
(a labs Splash)
About the shape
Torus knot family
A (2,3) torus knot winds twice around the ring and three times around its tube.
Show the program
x = (1+0.35cos(3u))cos(2u)
y = 0.35sin(3u)
z = (1+0.35cos(3u))sin(2u)
u = 0 .. 2pi
v = 0 .. 1
hue = u/(2pi)
size = 0.05
count = 3500
Run it
(a labs Splash)
About the shape
Things to try. Change a number and see what moves. Swap cos and
sin. Put t somewhere new. Make count small and
size big to see the single splats. Try spread = random on a
surface. Give a sphere a hue of floor(8v/pi)/8.
The Splash Manual, first published September 28, 2026 and updated October 11, 2026. Part
of
Splashery , a
playground of 3D Gaussian splats that runs in your browser. Every picture here was made
with Splashery itself.