Mercurial > hg > octave-nkf
annotate scripts/general/pol2cart.m @ 14570:d07d96e53612 stable
seconds after the minute can be 0-60, not 0-61
* system.txi (Timing Utilities): Correct possible values for number of
seconds in time structures. From Rafael Arndt <rafaelarndt@gmail.com>.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 17 Apr 2012 14:42:49 -0400 |
parents | 72c96de7a403 |
children | f3d52523cde1 |
rev | line source |
---|---|
14138
72c96de7a403
maint: update copyright notices for 2012
John W. Eaton <jwe@octave.org>
parents:
11587
diff
changeset
|
1 ## Copyright (C) 2000-2012 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 -*- | |
10688
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
9168
diff
changeset
|
20 ## @deftypefn {Function File} {[@var{x}, @var{y}] =} pol2cart (@var{theta}, @var{r}) |
5610 | 21 ## @deftypefnx {Function File} {[@var{x}, @var{y}, @var{z}] =} pol2cart (@var{theta}, @var{r}, @var{z}) |
10793
be55736a0783
Grammarcheck the documentation from m-files.
Rik <octave@nomad.inbox5.com>
parents:
10688
diff
changeset
|
22 ## @deftypefnx {Function File} {[@var{x}, @var{y}] =} pol2cart (@var{p}) |
10688
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
9168
diff
changeset
|
23 ## @deftypefnx {Function File} {[@var{x}, @var{y}, @var{z}] =} pol2cart (@var{p}) |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
9168
diff
changeset
|
24 ## @deftypefnx {Function File} {@var{C} =} pol2cart (@dots{}) |
9168
742cf6388a8f
Update section 17.7 (Coordinate Transformations) of arith.txi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
25 ## Transform polar or cylindrical to Cartesian coordinates. |
10688
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
9168
diff
changeset
|
26 ## |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
9168
diff
changeset
|
27 ## @var{theta}, @var{r}, (and @var{z}) must be the same shape, or scalar. |
9168
742cf6388a8f
Update section 17.7 (Coordinate Transformations) of arith.txi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
28 ## @var{theta} describes the angle relative to the positive x-axis. |
8491
aaff46fef256
[docs] fix hypenation: x - axis => x-axis, etc
Brian Gough <bjg@gnu.org>
parents:
7017
diff
changeset
|
29 ## @var{r} is the distance to the z-axis (0, 0, z). |
11587
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
30 ## If called with a single matrix argument then each row of @var{p} |
10688
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
9168
diff
changeset
|
31 ## represents the polar/(cylindrical) coordinate (@var{x}, @var{y} (, @var{z})). |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
9168
diff
changeset
|
32 ## |
11587
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
33 ## If only a single return argument is requested then return a matrix |
10688
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
9168
diff
changeset
|
34 ## @var{C} where each row represents one Cartesian coordinate |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
9168
diff
changeset
|
35 ## (@var{x}, @var{y} (, @var{z})). |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
9168
diff
changeset
|
36 ## @seealso{cart2pol, sph2cart, cart2sph} |
3803 | 37 ## @end deftypefn |
38 | |
39 ## Author: Kai Habel <kai.habel@gmx.de> | |
40 ## Adapted-by: jwe | |
41 | |
8533
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8507
diff
changeset
|
42 function [x, y, z] = pol2cart (theta, r, z) |
3803 | 43 |
10688
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
9168
diff
changeset
|
44 if (nargin < 1 || nargin > 3) |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
9168
diff
changeset
|
45 print_usage (); |
3803 | 46 endif |
47 | |
10688
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
9168
diff
changeset
|
48 if (nargin == 1) |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
9168
diff
changeset
|
49 if (ismatrix (theta) && (columns (theta) == 2 || columns (theta) == 3)) |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
9168
diff
changeset
|
50 if (columns (theta) == 3) |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
9168
diff
changeset
|
51 z = theta(:,3); |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
9168
diff
changeset
|
52 else |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
9168
diff
changeset
|
53 z = []; |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
9168
diff
changeset
|
54 endif |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
9168
diff
changeset
|
55 r = theta(:,2); |
11587
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
56 theta = theta(:,1); |
10688
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
9168
diff
changeset
|
57 else |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
9168
diff
changeset
|
58 error ("pol2car: matrix input must have 2 or 3 columns [THETA, R (, Z)]"); |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
9168
diff
changeset
|
59 endif |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
9168
diff
changeset
|
60 elseif (nargin == 2) |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
9168
diff
changeset
|
61 if (! ((ismatrix (theta) && ismatrix (r)) |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
9168
diff
changeset
|
62 && (size_equal (theta, r) || isscalar (theta) || isscalar (r)))) |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
9168
diff
changeset
|
63 error ("pol2cart: 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:
9168
diff
changeset
|
64 endif |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
9168
diff
changeset
|
65 elseif (nargin == 3) |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
9168
diff
changeset
|
66 if (! ((ismatrix (theta) && ismatrix (r) && ismatrix (z)) |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
9168
diff
changeset
|
67 && (size_equal (theta, r) || isscalar (theta) || isscalar (r)) |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
9168
diff
changeset
|
68 && (size_equal (theta, z) || isscalar (theta) || isscalar (z)) |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
9168
diff
changeset
|
69 && (size_equal (r, z) || isscalar (r) || isscalar (z)))) |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
9168
diff
changeset
|
70 error ("pol2cart: 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:
9168
diff
changeset
|
71 endif |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
9168
diff
changeset
|
72 endif |
8533
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8507
diff
changeset
|
73 |
10688
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
9168
diff
changeset
|
74 x = r .* cos (theta); |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
9168
diff
changeset
|
75 y = r .* sin (theta); |
8533
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8507
diff
changeset
|
76 |
10688
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
9168
diff
changeset
|
77 if (nargout <= 1) |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
9168
diff
changeset
|
78 x = [x, y, z]; |
3803 | 79 endif |
80 | |
8533
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8507
diff
changeset
|
81 endfunction |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8507
diff
changeset
|
82 |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8507
diff
changeset
|
83 %!test |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8507
diff
changeset
|
84 %! t = [0, 0.5, 1] * pi; |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8507
diff
changeset
|
85 %! r = 1; |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8507
diff
changeset
|
86 %! [x, y] = pol2cart (t, r); |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8507
diff
changeset
|
87 %! assert (x, [1, 0, -1], sqrt(eps)); |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8507
diff
changeset
|
88 %! assert (y, [0, 1, 0], sqrt(eps)); |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8507
diff
changeset
|
89 |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8507
diff
changeset
|
90 %!test |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8507
diff
changeset
|
91 %! t = [0, 1, 1] * pi/4; |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8507
diff
changeset
|
92 %! r = sqrt(2) * [0, 1, 2]; |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8507
diff
changeset
|
93 %! [x, y] = pol2cart (t, r); |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8507
diff
changeset
|
94 %! assert (x, [0, 1, 2], sqrt(eps)); |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8507
diff
changeset
|
95 %! assert (y, [0, 1, 2], sqrt(eps)); |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8507
diff
changeset
|
96 |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8507
diff
changeset
|
97 %!test |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8507
diff
changeset
|
98 %! t = [0, 1, 1] * pi/4; |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8507
diff
changeset
|
99 %! r = sqrt(2) * [0, 1, 2]; |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8507
diff
changeset
|
100 %! z = [0, 1, 2]; |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8507
diff
changeset
|
101 %! [x, y, z2] = pol2cart (t, r, z); |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8507
diff
changeset
|
102 %! assert (x, [0, 1, 2], sqrt(eps)); |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8507
diff
changeset
|
103 %! assert (y, [0, 1, 2], sqrt(eps)); |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8507
diff
changeset
|
104 %! assert (z, z2); |
3803 | 105 |
8533
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8507
diff
changeset
|
106 %!test |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8507
diff
changeset
|
107 %! t = 0; |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8507
diff
changeset
|
108 %! r = [0, 1, 2]; |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8507
diff
changeset
|
109 %! z = [0, 1, 2]; |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8507
diff
changeset
|
110 %! [x, y, z2] = pol2cart (t, r, z); |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8507
diff
changeset
|
111 %! assert (x, [0, 1, 2], sqrt(eps)); |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8507
diff
changeset
|
112 %! assert (y, [0, 0, 0], sqrt(eps)); |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8507
diff
changeset
|
113 %! assert (z, z2); |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8507
diff
changeset
|
114 |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8507
diff
changeset
|
115 %!test |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8507
diff
changeset
|
116 %! t = [1, 1, 1]*pi/4; |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8507
diff
changeset
|
117 %! r = 1; |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8507
diff
changeset
|
118 %! z = [0, 1, 2]; |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8507
diff
changeset
|
119 %! [x, y, z2] = pol2cart (t, r, z); |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8507
diff
changeset
|
120 %! assert (x, [1, 1, 1] / sqrt(2), eps); |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8507
diff
changeset
|
121 %! assert (y, [1, 1, 1] / sqrt(2), eps); |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8507
diff
changeset
|
122 %! assert (z, z2); |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8507
diff
changeset
|
123 |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8507
diff
changeset
|
124 %!test |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8507
diff
changeset
|
125 %! t = 0; |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8507
diff
changeset
|
126 %! r = [1, 2, 3]; |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8507
diff
changeset
|
127 %! z = 1; |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8507
diff
changeset
|
128 %! [x, y, z2] = pol2cart (t, r, z); |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8507
diff
changeset
|
129 %! assert (x, [1, 2, 3], eps); |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8507
diff
changeset
|
130 %! assert (y, [0, 0, 0] / sqrt(2), eps); |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8507
diff
changeset
|
131 %! assert (z, z2); |
fb1b87ea4af9
Permit scalars when transforming coordinates.
Ben Abbott <bpabbott@mac.com>
parents:
8507
diff
changeset
|
132 |
10688
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
9168
diff
changeset
|
133 %!test |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
9168
diff
changeset
|
134 %! P = [0, 0; pi/4, sqrt(2); pi/4, 2*sqrt(2)]; |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
9168
diff
changeset
|
135 %! 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:
9168
diff
changeset
|
136 %! assert (pol2cart(P), C, sqrt(eps)); |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
9168
diff
changeset
|
137 |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
9168
diff
changeset
|
138 %!test |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
9168
diff
changeset
|
139 %! P = [0, 0, 0; pi/4, sqrt(2), 1; pi/4, 2*sqrt(2), 2]; |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
9168
diff
changeset
|
140 %! 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:
9168
diff
changeset
|
141 %! assert (pol2cart(P), C, sqrt(eps)); |
7357e37f34fa
coordinate transforms: add option to operate on column matrix of coordinates.
Rik <octave@nomad.inbox5.com>
parents:
9168
diff
changeset
|
142 |