Mercurial > hg > octave-nkf
annotate scripts/general/cart2pol.m @ 20798:128414587af2
don't print additional error message in argument list evaluation
* pt-arg-list.cc (tree_argument_list::convert_to_const_vector):
Don't call error for for failed argument evaluation.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 09 Oct 2015 16:52:49 -0400 |
parents | 7503499a252b |
children |
rev | line source |
---|---|
19898
4197fc428c7d
maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
1 ## Copyright (C) 2000-2015 Kai Habel |
3803 | 2 ## |
3 ## This file is part of Octave. | |
4 ## | |
5 ## Octave is free software; you can redistribute it and/or modify it | |
6 ## under the terms of the GNU General Public License as published by | |
7016 | 7 ## the Free Software Foundation; either version 3 of the License, or (at |
8 ## your option) any later version. | |
3803 | 9 ## |
10 ## Octave is distributed in the hope that it will be useful, but | |
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 ## General Public License for more details. | |
14 ## | |
15 ## You should have received a copy of the GNU General Public License | |
7016 | 16 ## along with Octave; see the file COPYING. If not, see |
17 ## <http://www.gnu.org/licenses/>. | |
3803 | 18 |
19 ## -*- texinfo -*- | |
9168
742cf6388a8f
Update section 17.7 (Coordinate Transformations) of arith.txi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
20 ## @deftypefn {Function File} {[@var{theta}, @var{r}] =} cart2pol (@var{x}, @var{y}) |
5610 | 21 ## @deftypefnx {Function File} {[@var{theta}, @var{r}, @var{z}] =} cart2pol (@var{x}, @var{y}, @var{z}) |
17585
36b9fa789d8e
Overhaul polar, spherical, cartesian conversion routiens when nargout == 1.
Rik <rik@octave.org>
parents:
14363
diff
changeset
|
22 ## @deftypefnx {Function File} {[@var{theta}, @var{r}] =} cart2pol (@var{C}) |
36b9fa789d8e
Overhaul polar, spherical, cartesian conversion routiens when nargout == 1.
Rik <rik@octave.org>
parents:
14363
diff
changeset
|
23 ## @deftypefnx {Function File} {[@var{theta}, @var{r}, @var{z}] =} cart2pol (@var{C}) |
36b9fa789d8e
Overhaul polar, spherical, cartesian conversion routiens when nargout == 1.
Rik <rik@octave.org>
parents:
14363
diff
changeset
|
24 ## @deftypefnx {Function File} {@var{P} =} cart2pol (@dots{}) |
10688
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
10687
diff
changeset
|
25 ## |
20368
7503499a252b
doc: Update docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
19898
diff
changeset
|
26 ## Transform Cartesian coordinates to polar or cylindrical coordinates. |
7503499a252b
doc: Update docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
19898
diff
changeset
|
27 ## |
7503499a252b
doc: Update docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
19898
diff
changeset
|
28 ## The inputs @var{x}, @var{y} (, and @var{z}) must be the same shape, or |
7503499a252b
doc: Update docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
19898
diff
changeset
|
29 ## scalar. If called with a single matrix argument then each row of @var{C} |
7503499a252b
doc: Update docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
19898
diff
changeset
|
30 ## represents the Cartesian coordinate (@var{x}, @var{y} (, @var{z})). |
10688
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
10687
diff
changeset
|
31 ## |
9168
742cf6388a8f
Update section 17.7 (Coordinate Transformations) of arith.txi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
32 ## @var{theta} describes the angle relative to the positive x-axis. |
20368
7503499a252b
doc: Update docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
19898
diff
changeset
|
33 ## |
10687
a8ce6bdecce5
Improve documentation strings.
Rik <octave@nomad.inbox5.com>
parents:
9168
diff
changeset
|
34 ## @var{r} is the distance to the z-axis @w{(0, 0, z)}. |
10688
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
10687
diff
changeset
|
35 ## |
20368
7503499a252b
doc: Update docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
19898
diff
changeset
|
36 ## If only a single return argument is requested then return a matrix @var{P} |
7503499a252b
doc: Update docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
19898
diff
changeset
|
37 ## where each row represents one polar/(cylindrical) coordinate |
10688
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
10687
diff
changeset
|
38 ## (@var{theta}, @var{phi} (, @var{z})). |
5642 | 39 ## @seealso{pol2cart, cart2sph, sph2cart} |
3803 | 40 ## @end deftypefn |
41 | |
42 ## Author: Kai Habel <kai.habel@gmx.de> | |
43 ## Adapted-by: jwe | |
44 | |
17585
36b9fa789d8e
Overhaul polar, spherical, cartesian conversion routiens when nargout == 1.
Rik <rik@octave.org>
parents:
14363
diff
changeset
|
45 function [theta, r, z] = cart2pol (x, y, z = []) |
3803 | 46 |
10688
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
10687
diff
changeset
|
47 if (nargin < 1 || nargin > 3) |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
10687
diff
changeset
|
48 print_usage (); |
3803 | 49 endif |
50 | |
10688
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
10687
diff
changeset
|
51 if (nargin == 1) |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
10687
diff
changeset
|
52 if (ismatrix (x) && (columns (x) == 2 || columns (x) == 3)) |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
10687
diff
changeset
|
53 if (columns (x) == 3) |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
10687
diff
changeset
|
54 z = x(:,3); |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
10687
diff
changeset
|
55 endif |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
10687
diff
changeset
|
56 y = x(:,2); |
11587
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
57 x = x(:,1); |
10688
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
10687
diff
changeset
|
58 else |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
10687
diff
changeset
|
59 error ("cart2pol: matrix input must have 2 or 3 columns [X, Y (, Z)]"); |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
10687
diff
changeset
|
60 endif |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
10687
diff
changeset
|
61 elseif (nargin == 2) |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
10687
diff
changeset
|
62 if (! ((ismatrix (x) && ismatrix (y)) |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
10687
diff
changeset
|
63 && (size_equal (x, y) || isscalar (x) || isscalar (y)))) |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
10687
diff
changeset
|
64 error ("cart2pol: arguments must be matrices of same size, or scalar"); |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
10687
diff
changeset
|
65 endif |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
10687
diff
changeset
|
66 elseif (nargin == 3) |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
10687
diff
changeset
|
67 if (! ((ismatrix (x) && ismatrix (y) && ismatrix (z)) |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
10687
diff
changeset
|
68 && (size_equal (x, y) || isscalar (x) || isscalar (y)) |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
10687
diff
changeset
|
69 && (size_equal (x, z) || isscalar (x) || isscalar (z)) |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
10687
diff
changeset
|
70 && (size_equal (y, z) || isscalar (y) || isscalar (z)))) |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
10687
diff
changeset
|
71 error ("cart2pol: arguments must be matrices of same size, or scalar"); |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
10687
diff
changeset
|
72 endif |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
10687
diff
changeset
|
73 endif |
8533
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8491
diff
changeset
|
74 |
10688
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
10687
diff
changeset
|
75 theta = atan2 (y, x); |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
10687
diff
changeset
|
76 r = sqrt (x .^ 2 + y .^ 2); |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
10687
diff
changeset
|
77 |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
10687
diff
changeset
|
78 if (nargout <= 1) |
17585
36b9fa789d8e
Overhaul polar, spherical, cartesian conversion routiens when nargout == 1.
Rik <rik@octave.org>
parents:
14363
diff
changeset
|
79 theta = [theta(:), r(:), z(:)]; |
3803 | 80 endif |
81 | |
8533
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8491
diff
changeset
|
82 endfunction |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8491
diff
changeset
|
83 |
14363
f3d52523cde1
Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
84 |
8533
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8491
diff
changeset
|
85 %!test |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8491
diff
changeset
|
86 %! x = [0, 1, 2]; |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8491
diff
changeset
|
87 %! y = 0; |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8491
diff
changeset
|
88 %! [t, r] = cart2pol (x, y); |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8491
diff
changeset
|
89 %! assert (t, [0, 0, 0]); |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8491
diff
changeset
|
90 %! assert (r, x); |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8491
diff
changeset
|
91 |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8491
diff
changeset
|
92 %!test |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8491
diff
changeset
|
93 %! x = [0, 1, 2]; |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8491
diff
changeset
|
94 %! y = [0, 1, 2]; |
17585
36b9fa789d8e
Overhaul polar, spherical, cartesian conversion routiens when nargout == 1.
Rik <rik@octave.org>
parents:
14363
diff
changeset
|
95 %! P = cart2pol (x, y); |
36b9fa789d8e
Overhaul polar, spherical, cartesian conversion routiens when nargout == 1.
Rik <rik@octave.org>
parents:
14363
diff
changeset
|
96 %! assert (P(:,1), [0; pi/4; pi/4], sqrt (eps)); |
36b9fa789d8e
Overhaul polar, spherical, cartesian conversion routiens when nargout == 1.
Rik <rik@octave.org>
parents:
14363
diff
changeset
|
97 %! assert (P(:,2), sqrt (2)*[0; 1; 2], sqrt (eps)); |
8533
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8491
diff
changeset
|
98 |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8491
diff
changeset
|
99 %!test |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8491
diff
changeset
|
100 %! x = [0, 1, 2]; |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8491
diff
changeset
|
101 %! y = [0, 1, 2]; |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8491
diff
changeset
|
102 %! z = [0, 1, 2]; |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8491
diff
changeset
|
103 %! [t, r, z2] = cart2pol (x, y, z); |
14363
f3d52523cde1
Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
104 %! assert (t, [0, pi/4, pi/4], sqrt (eps)); |
f3d52523cde1
Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
105 %! assert (r, sqrt (2)*[0, 1, 2], sqrt (eps)); |
8533
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8491
diff
changeset
|
106 %! assert (z, z2); |
3803 | 107 |
8533
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8491
diff
changeset
|
108 %!test |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8491
diff
changeset
|
109 %! x = [0, 1, 2]; |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8491
diff
changeset
|
110 %! y = 0; |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8491
diff
changeset
|
111 %! z = 0; |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8491
diff
changeset
|
112 %! [t, r, z2] = cart2pol (x, y, z); |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8491
diff
changeset
|
113 %! assert (t, [0, 0, 0], eps); |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8491
diff
changeset
|
114 %! assert (r, x, eps); |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8491
diff
changeset
|
115 %! assert (z, z2); |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8491
diff
changeset
|
116 |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8491
diff
changeset
|
117 %!test |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8491
diff
changeset
|
118 %! x = 0; |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8491
diff
changeset
|
119 %! y = [0, 1, 2]; |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8491
diff
changeset
|
120 %! z = 0; |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8491
diff
changeset
|
121 %! [t, r, z2] = cart2pol (x, y, z); |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8491
diff
changeset
|
122 %! assert (t, [0, 1, 1]*pi/2, eps); |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8491
diff
changeset
|
123 %! assert (r, y, eps); |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8491
diff
changeset
|
124 %! assert (z, z2); |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8491
diff
changeset
|
125 |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8491
diff
changeset
|
126 %!test |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8491
diff
changeset
|
127 %! x = 0; |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8491
diff
changeset
|
128 %! y = 0; |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8491
diff
changeset
|
129 %! z = [0, 1, 2]; |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8491
diff
changeset
|
130 %! [t, r, z2] = cart2pol (x, y, z); |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8491
diff
changeset
|
131 %! assert (t, 0); |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8491
diff
changeset
|
132 %! assert (r, 0); |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8491
diff
changeset
|
133 %! assert (z, z2); |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8491
diff
changeset
|
134 |
10688
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
10687
diff
changeset
|
135 %!test |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
10687
diff
changeset
|
136 %! C = [0, 0; 1, 1; 2, 2]; |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
10687
diff
changeset
|
137 %! P = [0, 0; pi/4, sqrt(2); pi/4, 2*sqrt(2)]; |
14363
f3d52523cde1
Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
138 %! assert (cart2pol (C), P, sqrt (eps)); |
10688
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
10687
diff
changeset
|
139 |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
10687
diff
changeset
|
140 %!test |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
10687
diff
changeset
|
141 %! C = [0, 0, 0; 1, 1, 1; 2, 2, 2]; |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
10687
diff
changeset
|
142 %! P = [0, 0, 0; pi/4, sqrt(2), 1; pi/4, 2*sqrt(2), 2]; |
14363
f3d52523cde1
Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
143 %! assert (cart2pol (C), P, sqrt (eps)); |
10688
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
10687
diff
changeset
|
144 |