Mercurial > octave-nkf
comparison scripts/general/cart2pol.m @ 6786:bb5958d3510a
[project @ 2007-07-23 17:28:15 by jwe]
author | jwe |
---|---|
date | Mon, 23 Jul 2007 17:28:15 +0000 |
parents | 045038e0108a |
children | 93c65f2a5668 |
comparison
equal
deleted
inserted
replaced
6785:5ce6ecc1377b | 6786:bb5958d3510a |
---|---|
38 | 38 |
39 if (nargin == 2 && nargout > 2) | 39 if (nargin == 2 && nargout > 2) |
40 error ("cart2pol: number of output arguments must not be greater than number of input arguments"); | 40 error ("cart2pol: number of output arguments must not be greater than number of input arguments"); |
41 endif | 41 endif |
42 | 42 |
43 if ((! (ismatrix (X) && ismatrix (Y))) | 43 if (! (ismatrix (X) && ismatrix (Y)) |
44 || (! size_equal (X, Y)) | 44 || ! size_equal (X, Y) |
45 || (nargin == 3 && (! (size (X) == size (Z) && ismatrix (Z))))) | 45 || (nargin == 3 && ! (size_equal (X, Z) && ismatrix (Z)))) |
46 error ("cart2pol: arguments must be matrices of same size"); | 46 error ("cart2pol: arguments must be matrices of same size"); |
47 endif | 47 endif |
48 | 48 |
49 Theta = atan2 (Y, X); | 49 Theta = atan2 (Y, X); |
50 R = sqrt (X .^ 2 + Y .^ 2); | 50 R = sqrt (X .^ 2 + Y .^ 2); |