Compute the cosine between every pair of particles’ displacements.
t : DataFrame
trajectories, containing columns particle, frame, x, and y
frame1 : frame number
frame2 : frame number
DataFrame, indexed by particle, including dx, dy, and direction