Phase angle
P = angle(Z)
P = angle(Z)
returns the
phase angles, in radians, for each element of complex array Z
.
The angles lie between ±π.
For complex Z
, the magnitude R
and
phase angle theta
are given by
R = abs(Z) theta = angle(Z)
and the statement
Z = R.*exp(i*theta)
converts back to the original complex Z
.
The angle
function takes a complex number z = x +
iy and calculates atan2(y,x)
to find the angle formed
in the xy-plane between the positive x-axis and a ray from the origin to the point
(x,y). This phase angle is also the imaginary part of the complex logarithm,
since