Argument (complex Analysis) - Computation

Computation

The principal value Arg of a complex number given as x+iy is normally available in programming languages using the function atan2( ) or some language specific variant. The value of atan2(y, x) is the principal value in the range (−π, π].

Many texts say the value is given by arctan(y/x), as y/x is slope, and arctan converts slope to angle. This is correct only when x > 0, so the quotient is defined and the angle lies between −π/2 and π/2, but extending this definition to cases where x is not positive is relatively involved. Specifically, one may define the principal value of the argument separately on the four half-planes x > 0, x < 0 (separated into two quadrants if one wishes a branch cut on the negative x-axis), y > 0, y < 0, and then patch together.

 \operatorname{Arg}(x + iy) = \operatorname{atan2}(y,x) = \begin{cases} \arctan \left( y/x \right) & \qquad x > 0 \\ \pi/2 - \arctan \left( x/y \right) & \qquad y > 0 \\ -\pi/2 - \arctan \left( x/y \right) & \qquad y < 0 \\ \pi + \arctan \left( y/x \right) & \qquad x < 0, y \ge 0 \\ -\pi + \arctan \left( y/x \right) & \qquad x < 0, y < 0 \\ \text{undefined} & \qquad x = 0, y = 0 \end{cases}

For the variant where Arg is defined to lie in the interval [0, 2π), the value can be found by adding 2π to the value above when it is negative.

Alternatively, the principal value can be calculated in a uniform way using the tangent half-angle formula, the function being defined over the complex plane but excluding the origin:


\operatorname{Arg}(x + iy) =
\begin{cases}
2 \arctan \left( \frac{y}{\sqrt{x^2+y^2}+x} \right) & \qquad x > 0 \text{ or } y \ne 0 \\
\pi & \qquad x < 0 \text{ and } y = 0 \\
\text{undefined} & \qquad x = 0 \text{ and } y = 0
\end{cases}

This is based on a parametrization of the circle (except for the negative x-axis) by rational functions. This version of Arg is not stable enough for numerical use but can be used in symbolic calculation. In many programming libraries there is a function called atan2 which performs an equivalent computation.

Read more about this topic:  Argument (complex Analysis)

Famous quotes containing the word computation:

    I suppose that Paderewski can play superbly, if not quite at his best, while his thoughts wander to the other end of the world, or possibly busy themselves with a computation of the receipts as he gazes out across the auditorium. I know a great actor, a master technician, can let his thoughts play truant from the scene ...
    Minnie Maddern Fiske (1865–1932)