working right-angle triangle