xyz2sph.m
来自「gps matlab 仿真程序(A collection of geodetic」· M 代码 · 共 19 行
M
19 行
function [az,va,d]=xyz2sph(x,y,z)% XYZ2SPH Converts Cartesian coordinates in a left-handed% (local geodetic) system to spherical coordinates.% Vectorized. See also SPH2XYZ.% Version: 7 Jul 96% Useage: [az,va,d]=xyz2sph(x,y,z)% Input: x \% y > vectors of cartesian coordinates (linear units)% z /% Output: az - vector of azimuths (radians)% va - vector of vertical angles (radians)% d - vector of distances (linear units)d=sqrt(x.*x+y.*y+z.*z);az=atan2(y,x);%az=atan(y./x);%az=az+(x<0)*pi; % 2nd & 3rd quad%az=az+(az<0)*2*pi; % 4th quadva=asin(z./d);
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?