1

Boids Emergence

Complex self-organizing flocking dynamics emerging entirely from three simple local rules: alignment, cohesion, and separation.

Playground
60 FPS Canvas 2D
Click + Drag to interact with field

Live Parameters

Boid Population 250
Total agent count
ƒ

Mathematical Formulation

78 chars high
Analytical Equation
\mathbf{a}_i = w_a \mathbf{v}_{\text{align}} + w_c \mathbf{v}_{\text{cohere}} + w_s \mathbf{v}_{\text{separate}} + \mathbf{F}_{\text{center}}
Compact Formula
v += align * 0.05 + cohere * 0.005 + separate * 0.15, p += clamp(v, maxSpeed)
Renderer Logic
vx[i] += alignX * 0.05 + cohereX * 0.005 + separateX * 0.15;
vy[i] += alignY * 0.05 + cohereY * 0.005 + separateY * 0.15;
const speed = Math.sqrt(vx[i] * vx[i] + vy[i] * vy[i]);
if (speed > maxSpeed) {
  vx[i] = (vx[i] / speed) * maxSpeed;
  vy[i] = (vy[i] / speed) * maxSpeed;
}
Open in Playground Zero Dependencies • Standalone

Mathematical Tags

#boids #flocking #artificial-life #emergence #particles #vectors
Author: Math Art Core Target: 60 FPS

Export & Embed: Boids Emergence

4K PNG Snapshot

High-resolution single frame render

WebM Video (5s Loop)

60 FPS browser-captured stream

HTML Iframe Embed

<iframe src="https://art.fazleyrabbi.xyz/embed/boids-flocking" width="500" height="500" frameborder="0" loading="lazy"></iframe>
ESC
↑↓ Navigate Select
25 Mathematical Artworks