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}}, {{pi}}]. In other words, atan2(''y'', ''x'') is the angle between the positive ''x''-axis of a plane and the point (''x'', ''y'') on it, with positive sign for counter-clockwise angles (upper half-plane, ''y'' > 0), and negative sign for clockwise angles (lower half-plane, ''y'' < 0).
:<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'' + '''i'''''y''.
This limited version of the function above may also be defined using the [[tangent half-angle formula]]e as follows:
|