The direction \(\hat{d}\) is determined by including repulsion, orientation, and attraction forces, as outlined in \cite{COUZIN_2002}.   This has parameters \(r_r,~r_o,\text{and } r_a \), which represent the the radii for repulsion, orientation, and attraction, and also \(\alpha\), which is the maximal viewing angle.
We use this model, instead of the original form in \cite{COUZIN2002} or the slightly updated form in \cite{Ioannou_2012}, because the directional changes are smooth and continuous, which makes for a more appropriate calculation of the velocity correlations.  This form yields similar results as the original model, for the parameter dependence, and existence of emergent group polarized and milling states, and for switching between states.