Mercurial > hg > octave-lyh
diff scripts/general/cart2sph.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 | 72c96de7a403 |
line wrap: on
line diff
--- a/scripts/general/cart2sph.m +++ b/scripts/general/cart2sph.m @@ -26,11 +26,11 @@ ## @var{phi} is the angle relative to the xy-plane. ## @var{r} is the distance to the origin @w{(0, 0, 0)}. ## @var{x}, @var{y}, and @var{z} must be the same shape, or scalar. -## If called with a single matrix argument then each row of @var{c} +## If called with a single matrix argument then each row of @var{c} ## represents the Cartesian coordinate (@var{x}, @var{y}, @var{z}). -## -## If only a single return argument is requested then return a matrix -## @var{s} where each row represents one spherical coordinate +## +## If only a single return argument is requested then return a matrix +## @var{s} where each row represents one spherical coordinate ## (@var{theta}, @var{phi}, @var{r}). ## @seealso{sph2cart, cart2pol, pol2cart} ## @end deftypefn @@ -46,9 +46,9 @@ if (nargin == 1) if (ismatrix (x) && columns (x) == 3) - z = x(:,3); - y = x(:,2); - x = x(:,1); + z = x(:,3); + y = x(:,2); + x = x(:,1); else error ("cart2sph: matrix input must have 3 columns [X, Y, Z]"); endif