cv.cartToPolar - MATLAB File Help |
Calculates the magnitude and angle of 2D vectors
[mag, ang] = cv.cartToPolar(x, y)
[...] = cv.cartToPolar(..., 'OptionName',optionValue, ...)
x
.x
.x
; the
angles are measured in radians (from 0 to 2*pi) or in degrees (0 to 360
degrees).The function cv.cartToPolar calculates either the magnitude, angle, or both
for every 2D vector (x(I),y(I))
:
magnitude(I) = sqrt(x(I)^2 + y(I)^2)
angle(I) = atan2(y(I), x(I)) [* (180/pi)]
The angles are calculated with accuracy about 0.3 degrees. For the point
(0,0)
, the angle is set to 0.