Add an angle function and fix JUnit tests