Every frame, each boid computes distance and angle vectors to neighbors within its radius of perception. The steering forces are calculated using these vector operations:
// Separation:
S = Σ (p - pi) / |p - pi|²
// Alignment:
A = (Σ vi) / N
// Cohesion:
C = ((Σ pi) / N) - p
These three resultant vectors are weighted, summed, and applied as an acceleration force to smoothly steer the boid's current velocity.