This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Argument (polar angle) of a complex number

MuPAD® notebooks are not recommended. Use MATLAB® live scripts instead.

MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.


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 non-zero complex number z = x + iy = |z| eiϕ 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 non-real 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 floating-point number is returned if one argument is given which is a floating-point number; or if two arguments are given, both of them are numerical and at least one of them is a floating-point 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.

Environment Interactions

When called with floating-point arguments, the function is sensitive to the environment variable DIGITS which determines the numerical working precision. Properties of identifiers are taken into account.


Example 1

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 floating-point arguments:

arg(2.0, 3), arg(2, 3.0), arg(10.0^100, 10.0^(-100))

Example 2

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):

Example 3

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)

Example 4

Use rewrite to convert symbolic calls of arg to the logarithmic representation:

rewrite(arg(x, y), ln)

Example 5

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 expression

x, y

arithmetical expressions representing real numbers

Return Values

Arithmetical expression.

Overloaded By

x, z

See Also

MuPAD Functions

Was this topic helpful?