use np.atan instead of math.atan