home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l460 / 2.ddi / SPECFUN.DI$ / CART2POL.M < prev    next >
Encoding:
Text File  |  1993-03-07  |  606 b   |  17 lines

  1. function [th,r,z] = cart2pol(x,y,z)
  2. %CART2POL Transform Cartesian coordinates to polar.
  3. %    [TH,R] = CART2POL(X,Y) transforms data stored in Cartesian
  4. %    coordinates to polar coordinates. If [M,N] = SIZE(X), then
  5. %    Y must be also be the same size. TH is returned in radians.
  6. %    [TH,R,Z] = CART2POL(X,Y,Z) transforms data stored in Cartesian  
  7. %    coordinates to cylindrical coordinates. If [M,N] = SIZE(X), then
  8. %    Y and Z must be the same size.
  9. %
  10. %    See also CART2SPH, SPH2CART, POL2CART.
  11.  
  12. %    L. Shure, 4-20-92.
  13. %    Copyright (c) 1984-93 by The MathWorks, Inc.
  14.  
  15. th = atan2(y,x);
  16. r = sqrt(x.^2+y.^2);
  17.