Argument (polar angle) of a complex number
This functionality does not run in MATLAB.
arg(z
) arg(x
,y
)
arg(z)
returns the argument of the complex
number z
.
arg(x, y)
returns the argument of the complex
number with real part x
and imaginary part y
.
This function is also known as atan2
in other
mathematical languages.
The argument of a nonzero complex number z = x + i y =
z e^{i ϕ} is
its real polar angle ϕ. arg(x,y)
represents
the principal value
.
For x ≠ 0, y ≠
0, it is given by
An error occurs if arg
is called with two
arguments and either one of the arguments x
, y
is
a nonreal numerical value. Symbolic arguments are assumed to be real.
On the other hand, if arg
is called with
only one argument x + I*y
, it is not assumed that x
and y
are
real.
A floatingpoint number is returned if one argument is given which is a floatingpoint number; or if two arguments are given, both of them are numerical and at least one of them is a floatingpoint number.
If the sign of the arguments can be determined, then the result
is expressed in terms of arctan
.
Cf. Example 2. Otherwise, a
symbolic call of arg
is returned. Numerical factors
are eliminated from the first argument. Cf. Example 3.
A symbolic call to arg
returned has only
one argument.
The call arg(0,0)
, or equivalently arg(0)
,
returns 0
.
An alternative representation is . Cf. Example 4.
When called with floatingpoint arguments, the function is sensitive
to the environment variable DIGITS
which determines the numerical
working precision. Properties of identifiers are taken into account.
We demonstrate some calls with exact and symbolic input data:
arg(2, 3), arg(x, 4), arg(4, y), arg(x, y), arg(10, y + PI)
If arg
is called with two arguments, the
arguments are implicitly assumed to be real, which allows some additional
simplifications compared to a call with only one argument:
arg(1, y), arg(1 + I*y)
arg(x, infinity), arg(infinity, 3), arg(infinity, 3)
Floating point values are computed for floatingpoint arguments:
arg(2.0, 3), arg(2, 3.0), arg(10.0^100, 10.0^(100))
arg
reacts to properties of
identifiers set via assume
:
assume(x > 0): assume(y < 0): arg(x, y)
assume(x < 0): assume(y > 0): arg(x, y)
assume(x <> 0): arg(x, 3)
unassume(x), unassume(y):
Certain simplifications may occur in unevaluated calls. In particular, numerical factors are eliminated from the first argument:
arg(3*x, 9*y), arg(12*sqrt(2)*x, 12*y)
Use rewrite
to
convert symbolic calls of arg
to the logarithmic
representation:
rewrite(arg(x, y), ln)
System functions such as float
, limit
, or series
handle expressions involving arg
:
limit(arg(x, x^2/(1+x)), x = infinity)
series(arg(x, x^2), x = 1, 4, Real)
 

arithmetical expressions representing real numbers 
Arithmetical expression.
x
, z