Moved the function to calculate the reflected direction to interactions.h.