← gallery
About the math

Forty-three fish. Each row (y = i/235) is one fish. The term sin(y−t)·2 flexes its whole spine side-to-side over time — that's the swim. cos(i/40) lays points from nose to tail along the body.

Darting. The d⁴/2·cos(2t−d²) term is each fish's lunge: when its distance d grows, the fourth power makes it burst forward hard, then settle. That's why individuals suddenly shoot off and drift back.

The school. All 43 share the 79·sin(c) path arc — they sweep together, but every fish's spine ripple (sin(e·9−d·6+t)) is at a different phase, so the school ripples like a real bait ball.

a=(y,d=mag(k=(5+sin(y-t)*2)*cos(i/40),e=y/6-11)/4)=>point((79+k*k)*cos(c=d-t/4)+200,3*sin(k*2)+.2/k+y/9*k*(2+sin(e*9-d*6+t))+79*sin(c)+200+d**4/2*cos(t*2-d*d)) · called a(i/235)