Inferred interaction rules as a function of distance and direction to the neighbour. In all these plots, the focal individual can be imagined to be situated in the centre of the plot, heading towards the top of the page, and the coordinates of each cell in the polar grid correspond to the position of the neighbour. Top row Individuals moving in a front-back configuration. Bottom row Individuals moving side by side. (a) and (d) Number of counts of the neighbour within each cell of the polar grid. The positions at which the neighbour is most frequently observed match those imposed when generating the trajectories. (b) Turning response. When the individuals move in a front-back configuration, turning always happens in the direction of the neighbour. (c) Acceleration response for individuals moving in a front-back configuration. Close-by neighbours elicit a repulsive response, with an acceleration of the opposite sign. (e) Turning response of individuals moving side by side. Repulsion is mediated through turning away from the neighbour. (f) Acceleration response. For individuals moving side by side, acceleration is always positive when the neighbour is in front and negative when the neighbour is behind.