Forum Discussion

DayoungPark's avatar
DayoungPark
Copper Contributor
Jul 25, 2025

ATAN(), ATAN2() return same value?

In below site, M365 said that

ATAN2(a,b) is the same as ATAN(b/a), except that a can be zero in ATAN2.

 

(https://support.microsoft.com/ko-kr/office/atan2-%ED%95%A8%EC%88%98-c04592ab-b9e3-4908-b428-c96b3a565033)

 

I think the result values of the two functions below should be the same, but returns different values.

ATAN2((K5-$C$3),TAN(K7)*K5+$C$2)
ATAN(TAN(K7)*K5+$C$2/(K5-$C$3))

K5 : 10

K7 : RADIANS(-57)

C2 : 0.761

C3 : 2.176

 

 

Please tell me why..

 

2 Replies

  • As SergeiBaklan​ pointed out, you have omitted as set of parentheses in the division.

    However, care needs to be taken because ATAN loses sign information when the division is carried out and only returns angles in the range -π/2 to +π/2.  ATAN2 retains information on the sign of each parameter and so can return angles in the range 0 to 2π. 

    The angles returned by the two functions may differ by π.  In the present case, I believe entering a value of 32.176 in cell $C$3 will still make the corrected formulas give different results because it results in a sign change.

  • SergeiBaklan's avatar
    SergeiBaklan
    Diamond Contributor

    If you use

    =ATAN( (TAN(K7)*K5+$C$2) / (K5-$C$3) )

    instead of

    =ATAN( TAN(K7)*K5 + $C$2/(K5-$C$3) )

    both ATAN and ATAN2 give exactly the same result.

Resources