If you keep your brain working over three nights and get up with only silly ideas each morning, just set a meeting with someone.
Circular data especially trick us not to stop thinking but get any ideal solutions.
In a meeting with Richard, he suggested a straightforward Matlab function that solved our problems at once. That's how we should work on 'complicated' calculations, which turned out not really in the end.