add angles algorithm by Knyazev and Argentati