Mercurial > octave-antonio
comparison scripts/plot/isonormals.m @ 11587:c792872f8942
all script files: untabify and strip trailing whitespace
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 20 Jan 2011 17:35:29 -0500 |
parents | fd0a3ac60b0e |
children | 0579a13f29a1 |
comparison
equal
deleted
inserted
replaced
11586:12df7854fa7c | 11587:c792872f8942 |
---|---|
116 x = varargin{1}; | 116 x = varargin{1}; |
117 y = varargin{2}; | 117 y = varargin{2}; |
118 z = varargin{3}; | 118 z = varargin{3}; |
119 c = varargin{4}; | 119 c = varargin{4}; |
120 vp = varargin{5}; | 120 vp = varargin{5}; |
121 otherwise | 121 otherwise |
122 print_usage (); | 122 print_usage (); |
123 endswitch | 123 endswitch |
124 if (ismatrix (vp) && size (vp,2) == 3) | 124 if (ismatrix (vp) && size (vp,2) == 3) |
125 pa = []; | 125 pa = []; |
126 v = vp; | 126 v = vp; |
147 endswitch | 147 endswitch |
148 endfunction | 148 endfunction |
149 | 149 |
150 %!test | 150 %!test |
151 %! [x, y, z] = meshgrid (0:.5:2, 0:.5:2, 0:.5:2); | 151 %! [x, y, z] = meshgrid (0:.5:2, 0:.5:2, 0:.5:2); |
152 %! c = abs ((x-.5).^2 + (y-.5).^2 + (z-.5).^2); | 152 %! c = abs ((x-.5).^2 + (y-.5).^2 + (z-.5).^2); |
153 %! [f, v, cdat] = isosurface (x, y, z, c, .4, y); | 153 %! [f, v, cdat] = isosurface (x, y, z, c, .4, y); |
154 %! n = isonormals (x, y, z, c, v); | 154 %! n = isonormals (x, y, z, c, v); |
155 %! assert (size (v), size (n)); | 155 %! assert (size (v), size (n)); |
156 %!test | 156 %!test |
157 %! [x, y, z] = meshgrid (0:.5:2, 0:.5:2, 0:.5:2); | 157 %! [x, y, z] = meshgrid (0:.5:2, 0:.5:2, 0:.5:2); |
158 %! c = abs ((x-.5).^2 + (y-.5).^2 + (z-.5).^2); | 158 %! c = abs ((x-.5).^2 + (y-.5).^2 + (z-.5).^2); |
159 %! [f, v, cdat] = isosurface (x, y, z, c, .4, y); | 159 %! [f, v, cdat] = isosurface (x, y, z, c, .4, y); |
160 %! np = isonormals (x, y, z, c, v); | 160 %! np = isonormals (x, y, z, c, v); |
161 %! nn = isonormals (x, y, z, c, v, "negate"); | 161 %! nn = isonormals (x, y, z, c, v, "negate"); |
162 %! assert (all (np == -nn)); | 162 %! assert (all (np == -nn)); |