[utils] fix computation of U in angles()