sph2cart.m

来自「一个很好用的摄像机标定程序」· M 代码 · 共 20 行

M
20
字号
function [x,y,z] = sph2cart(az,elev,r)%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 (azumith 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.%%   See also cart2sph%az = az * (pi/180);%elev = elev * (pi/180);x = r * sin( pi/2 - elev ) * cos( az );y = r * sin( pi/2 - elev ) * sin( az );z = r * cos( pi/2 - elev );

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?