An argument of the complex number z = x + iy, denoted arg(z), is defined in two equivalent ways:
Geometrically, in the complex plane, as the 2D polar angle from the positive real axis to the vector representing z. The numeric value is given by the angle in radians, and is positive if measured counterclockwise.
Algebraically, as any real quantity such that
for some positive real r (see Euler's formula). The quantity r is the modulus (or absolute value) of z, denoted |z|:
The names magnitude, for the modulus, and phase, for the argument, are sometimes used equivalently.
Under both definitions, it can be seen that the argument of any non-zero complex number has many possible values: firstly, as a geometrical angle, it is clear that whole circle rotations do not change the point, so angles differing by an integer multiple of 2πradians (a complete circle) are the same, as reflected by figure 2 on the right. Similarly, from the periodicity of sin and cos, the second definition also has this property. The argument of zero is usually left undefined.
The complex argument can also be defined algebraically in terms of complex roots as:
This definition removes reliance on other difficult-to-compute functions such as arctangent as well as eliminating the need for the piecewise definition. Because it's defined in terms of roots, it also inherits the principal branch of square root as its own principle branch. The normalization of by dividing by isn't necessary for convergence to the correct value, but it does speed up convergence and ensures that is left undefined.
Figure 3. The principal value Arg of the blue point at 1 + i is π/4. The red line here is the branch cut and corresponds to the two red lines in figure 4 seen vertically above each other).
Because a complete rotation around the origin leaves a complex number unchanged, there are many choices which could be made for by circling the origin any number of times. This is shown in figure 2, a representation of the multi-valued (set-valued) function , where a vertical line (not shown in the figure) cuts the surface at heights representing all the possible choices of angle for that point.
When a well-defined function is required, then the usual choice, known as the principal value, is the value in the open-closed interval(−π rad, π rad], that is from −π to πradians, excluding −π rad itself (equiv., from −180 to +180 degrees, excluding −180° itself). This represents an angle of up to half a complete circle from the positive real axis in either direction.
Some authors define the range of the principal value as being in the closed-open interval [0, 2π).
The principal value sometimes has the initial letter capitalized, as in Arg z, especially when a general version of the argument is also being considered. Note that notation varies, so arg and Arg may be interchanged in different texts.
The set of all possible values of the argument can be written in terms of Arg as:
The atan2 function (also called arctan2 or other synonyms) is available in the math libraries of many programming languages, and usually returns a 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 two half-planes x > 0 and 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.
A compact expression with 4 overlapping half-planes is
It's also possible to use arccotangent for the definition:
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 (when y<0).
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:
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 floating point computational use (as it may overflow near the region x < 0, y = 0), but can be used in symbolic calculation.
A variant of the last formula which avoids overflow is sometimes used in high precision computation:
One of the main motivations for defining the principal value Arg is to be able to write complex numbers in modulus-argument form. Hence for any complex number z,
This is only really valid if z is non-zero, but can be considered valid for z = 0 if Arg(0) is considered as an indeterminate form—rather than as being undefined.
Some further identities follow. If z1 and z2 are two non-zero complex numbers, then