Fixed the AnglesGradient fucntion to correctly calculate angle gradients and energies with respect to the full rotation and not just the minimal angle between the vectors.