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

  1. function [x,y,z] = sph2cart(az,elev,r)
  2. %SPH2CART Transform spherical coordinates to Cartesian.
  3. %    [X,Y,Z] = SPH2CART(AZ,EL,R) transforms data stored in spherical
  4. %    coordinates to Cartesian coordinates. If [M,N] = SIZE(AZ), then
  5. %    EL and R must be also be the same size. AZ and EL must be in radians.
  6. %
  7. %    See also CART2SPH, CART2POL, POL2CART.
  8.  
  9. %    L. Shure, 4-20-92.
  10. %    Copyright (c) 1984-93 by The MathWorks, Inc.
  11.  
  12. z = r .* sin(elev);
  13. x = r .* cos(elev) .* cos(az);
  14. y = r .* cos(elev) .* sin(az);
  15.