Calculating global rotation and polarization
The R, Python, and Julia code in this repository will calculate global rotation and global polarization for a group of animals, given their x-, y-coordinates and orientations. Global polarization describes the alignment within the group. Global rotation describes movement around the center of the group's mass. Equations for global rotation and polarization come from Couzin et al. 2002 (Journal of Theoretical Biology, ) with empirical validation in Tunstrøm et al. 2013 (PLoS Computational Biology). The equations are given below:
Group polarization and rotation each take on values between 0 and 1. Three distinct group "states" exist and are well-characterized by different combinations of global polarization and rotation:
- The swarm state (rotation < 0.35, polarization < 0.35) consists of disordered movement.
- The milling state (rotation > 0.65, polarization < 0.35) consists of rotation around the group center, i.e. a torus configuration.
- The polarized state (rotation < 0.35, polarization > 0.65) consists of directed movement.