each bird follows

400 birds, coloured by the way they fly · one bird and the birds it follows, outlined

colour = the way a bird is flying
One colour across the sky: the birds agree, order near 1. Every colour at once: each bird flies its own way, order near 0.

order now: 1 when all fly the same way, near 0 when they scatter

order against noise, birds at their closest (spread ×1)

order against spread, at noise 0.10

The model (Vicsek, 1995)

Every step, each bird turns to the average heading of the birds it follows, then wobbles by a random angle, then flies on at the same speed. The order φ is the length of the average heading: 1 when every bird flies the same way, close to 0 when they point everywhere.

θᵢ, θ̄ᵢthe heading of bird i, and the average heading of the birds it follows
xᵢthe position of bird i, written as a complex number, so eiθ is a step of length 1 in direction θ
Nᵢthe birds bird i follows: itself and either its 7 nearest birds, however far away (what starlings do: Ballerini et al., 2008), or every bird within a fixed reach r, set so that at spread ×1 the average bird has 7
ηnoise: each turn is off by a random angle of up to ±η·180°, so at most ±36° here
sspread: the distance between birds multiplied by s. A bird that follows everyone within reach then has 7/s² neighbours on average; a bird that follows its 7 nearest still has 7
v₀the speed, the same for every bird
hawka bird inside the hawk's circle stops following anyone and flies straight away from it, give or take 17°. The slider sets the circle's diameter as a share of the sky's width

The two curves on the right were computed once, 400 birds, six runs a point, each averaged over its last 2000 steps; the yellow dot is the flock on the left, measured as it flies.