Deal with large z/hypot(x, y)

lat should be PI/2 when z/hypot(x, y) is very large