Handle NaN in the verification of angles