?? cart2sph.m
字號(hào):
function [az,elev,r] = cart2sph(x,y,z)
%CART2SPH Transform Cartesian to spherical coordinates.
% [TH,PHI,R] = CART2SPH(X,Y,Z) transforms corresponding elements of
% data stored in Cartesian coordinates X,Y,Z to spherical
% coordinates (azimuth TH, elevation PHI, and radius R). The arrays
% X,Y, and Z must be the same size (or any of them can be scalar).
% TH and PHI are returned in radians.
%
% TH is the counterclockwise angle in the xy plane measured from the
% positive x axis. PHI is the elevation angle from the xy plane.
%
% Class support for inputs X,Y,Z:
% float: double, single
%
% See also CART2POL, SPH2CART, POL2CART.
% Copyright 1984-2005 The MathWorks, Inc.
% $Revision: 5.12.4.2 $ $Date: 2005/05/31 16:31:21 $
hypotxy = hypot(x,y);
r = hypot(hypotxy,z);
elev = atan2(z,hypotxy);
az = atan2(y,x);
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -