Trigonometric

Hello,

I know this is a really basic question. I get confused this with other languages.

I need to know how to code atan2 in root/C++

tan x= x0/y0 ----- r0=sqrt(x0^2 + y0^2))
sin x= x0/r0
cox x= y0/r0

(1)x= TMath::ATan2(x0,y0);
(2)x= TMath::ATan2(y0,x0);

Which one is the correct one ?

Thanks
Dil


Please read tips for efficient and successful posting and posting code

ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided


https://root.cern/doc/master/namespaceTMath.html

See also:
https://www.cplusplus.com/reference/cmath/atan2/