Mercurial > hg > octave-nkf
comparison scripts/general/cart2sph.m @ 6785:5ce6ecc1377b
[project @ 2007-07-23 16:59:00 by dbateman]
author | dbateman |
---|---|
date | Mon, 23 Jul 2007 17:00:55 +0000 |
parents | 045038e0108a |
children | bb5958d3510a |
comparison
equal
deleted
inserted
replaced
6784:ad4dd4124c16 | 6785:5ce6ecc1377b |
---|---|
36 print_usage (); | 36 print_usage (); |
37 endif | 37 endif |
38 | 38 |
39 if ((! (ismatrix (X) && ismatrix (Y) && ismatrix (Z))) | 39 if ((! (ismatrix (X) && ismatrix (Y) && ismatrix (Z))) |
40 || (! size_equal (X, Y)) | 40 || (! size_equal (X, Y)) |
41 || (! size_equal (X, Z)) | 41 || (! size_equal (X, Z))) |
42 error ("cart2sph: arguments must be matrices of same size"); | 42 error ("cart2sph: arguments must be matrices of same size"); |
43 endif | 43 endif |
44 | 44 |
45 Theta = atan2 (Y, X); | 45 Theta = atan2 (Y, X); |
46 Phi = atan2 (Z, sqrt (X .^ 2 + Y .^ 2)); | 46 Phi = atan2 (Z, sqrt (X .^ 2 + Y .^ 2)); |