I’m translating some functions from an Excel spreadsheet into python. I need to use atan2
which is arctan2 according to numpy docs:
arctan2. The problem is that the two results are not even close:
oc = 23.4384863405
sal = 89.7814630647
sra = np.arctan2(np.cos(np.deg2rad(sal)),
np.cos(np.deg2rad(oc))*np.sin(np.deg2rad(sal)))
results: Excel = 1.566714757 Numpy = 0.00415720646 ??
I trust the Excel results as it is correct. It is numpy that is wrong.
Now either I’m not using arctan2 correctly, or atan2 is not arctan2 in numpy, or there is a bug in numpy, or I’m just completely lost here.
I’m using python version 2.7.2 and numpy 1.6.2
Any ideas, please?
Thanks
From the Excel docs:
From the numpy docs:
They take their arguments in opposite order. Thus: