Mercurial > hg > octave-avbm
comparison scripts/plot/__plr2__.m @ 4030:22bd65326ec1
[project @ 2002-08-09 18:58:13 by jwe]
author | jwe |
---|---|
date | Fri, 09 Aug 2002 19:00:16 +0000 |
parents | 858695b3ed62 |
children | 57372235194b |
comparison
equal
deleted
inserted
replaced
4029:2cc57b6169cf | 4030:22bd65326ec1 |
---|---|
35 | 35 |
36 if (any (imag (rho))) | 36 if (any (imag (rho))) |
37 rho = real (rho); | 37 rho = real (rho); |
38 endif | 38 endif |
39 | 39 |
40 if (is_scalar (theta)) | 40 if (isscalar (theta)) |
41 if (is_scalar (rho)) | 41 if (isscalar (rho)) |
42 x = rho * cos (theta); | 42 x = rho * cos (theta); |
43 y = rho * sin (theta); | 43 y = rho * sin (theta); |
44 __plt2ss__ (x, y, fmt); | 44 __plt2ss__ (x, y, fmt); |
45 endif | 45 endif |
46 elseif (is_vector (theta)) | 46 elseif (isvector (theta)) |
47 if (is_vector (rho)) | 47 if (isvector (rho)) |
48 if (length (theta) != length (rho)) | 48 if (length (theta) != length (rho)) |
49 error ("polar: vector lengths must match"); | 49 error ("polar: vector lengths must match"); |
50 endif | 50 endif |
51 if (rows (rho) == 1) | 51 if (rows (rho) == 1) |
52 rho = rho'; | 52 rho = rho'; |
55 theta = theta'; | 55 theta = theta'; |
56 endif | 56 endif |
57 x = rho .* cos (theta); | 57 x = rho .* cos (theta); |
58 y = rho .* sin (theta); | 58 y = rho .* sin (theta); |
59 __plt2vv__ (x, y, fmt); | 59 __plt2vv__ (x, y, fmt); |
60 elseif (is_matrix (rho)) | 60 elseif (ismatrix (rho)) |
61 [t_nr, t_nc] = size (theta); | 61 [t_nr, t_nc] = size (theta); |
62 if (t_nr == 1) | 62 if (t_nr == 1) |
63 theta = theta'; | 63 theta = theta'; |
64 tmp = t_nr; | 64 tmp = t_nr; |
65 t_nr = t_nc; | 65 t_nr = t_nc; |
77 endif | 77 endif |
78 x = diag (cos (theta)) * rho; | 78 x = diag (cos (theta)) * rho; |
79 y = diag (sin (theta)) * rho; | 79 y = diag (sin (theta)) * rho; |
80 __plt2vm__ (x, y, fmt); | 80 __plt2vm__ (x, y, fmt); |
81 endif | 81 endif |
82 elseif (is_matrix (theta)) | 82 elseif (ismatrix (theta)) |
83 if (is_vector (rho)) | 83 if (isvector (rho)) |
84 [r_nr, r_nc] = size (rho); | 84 [r_nr, r_nc] = size (rho); |
85 if (r_nr == 1) | 85 if (r_nr == 1) |
86 rho = rho'; | 86 rho = rho'; |
87 tmp = r_nr; | 87 tmp = r_nr; |
88 r_nr = r_nc; | 88 r_nr = r_nc; |
100 endif | 100 endif |
101 diag_r = diag (rho); | 101 diag_r = diag (rho); |
102 x = diag_r * cos (theta); | 102 x = diag_r * cos (theta); |
103 y = diag_r * sin (theta); | 103 y = diag_r * sin (theta); |
104 __plt2mv__ (x, y, fmt); | 104 __plt2mv__ (x, y, fmt); |
105 elseif (is_matrix (rho)) | 105 elseif (ismatrix (rho)) |
106 if (size (rho) != size (theta)) | 106 if (size (rho) != size (theta)) |
107 error ("polar: matrix dimensions must match"); | 107 error ("polar: matrix dimensions must match"); |
108 endif | 108 endif |
109 x = rho .* cos (theta); | 109 x = rho .* cos (theta); |
110 y = rho .* sin (theta); | 110 y = rho .* sin (theta); |