Inverse trigonometric functions: Difference between revisions

Content deleted Content added
Two-argument variant of arctangent: present the definition of atan2 before explaining its relationship to atan
Tag: Reverted
Undid revision 1243963605 by 151.95.101.29 (talk) – this version is confusing (especially about the order of x, y), and there's really no problem with describing this as a kind of "arctangent" – it's right there in the name
Line 806:
{{anchor|Two-argument variant of arctangent}}
{{main|atan2}}
The two-argument [[atan2]] function computes the arctangent of ''y'' / ''x'' given ''y'' and ''x'', but with a range of (−{{pi}},&nbsp;{{pi}}]. In other words, atan2(''y'',&nbsp;''x'') is the angle between the positive ''x''-axis of a plane and the point (''x'',&nbsp;''y'') on it, with positive sign for counter-clockwise angles (upper half-plane, ''y''&nbsp;>&nbsp;0), and negative sign for clockwise angles (lower half-plane, ''y''&nbsp;<&nbsp;0). Equivalently, this is the the [[principal value]] of the [[arg (mathematics)|arg]]ument of the [[complex number]] ''x''&nbsp;+&nbsp;'''i'''''y''. atan2It was first introduced in many computer programming languages, but it is now also common in other fields of science and engineering.
 
It is related to the arctangent of ''y'' / ''x'' but, when {{math|''x'' < 0}}, the angle <math>\arctan(y / x)</math> is [[antipodal point|diametrically opposite]] the desired angle, and ±{{pi}} (a half [[turn (angle)|turn]]) must be added to place the point in the correct [[quadrant (plane geometry)|quadrant]]; the result has a range of (−{{pi}},&nbsp;{{pi}}]. In addition, atan2 can be computed for {{math|1=''x'' = 0}} without dividing by zero.
More formally, that is how atan2 can be expressed inIn terms of the standard '''arctan''' function, that is with range of (−{{sfrac|{{pi}}|2}}, {{sfrac|{{pi}}|2}}), it can be expressed as follows:
 
:<math>\operatorname{atan2}(y, x) = \begin{cases}
Line 820 ⟶ 818:
\text{undefined} & \quad y = 0,\; x = 0
\end{cases}</math>
 
It also equals the [[principal value]] of the [[arg (mathematics)|arg]]ument of the [[complex number]] ''x''&nbsp;+&nbsp;'''i'''''y''.
 
This limited version of the function above may also be defined using the [[tangent half-angle formula]]e as follows: