dir2angle.m

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

M
29
字号
function angles = dir2angle(directions)%angles = DIR2ANGLE(directions)%%Convert directions to azimuth/elevation pairs%%Input:%  DIRECTIONS - directions vectors (array N x 3)%%Output:%  ANGLES     - azimuths and elevations of the directions (array N x 2,%               in the range <0, 360) x  <-90, 90> degrees)%%See also:%  ANGLE2DIR, DIR2ROT%%Radim Halir, Charles University Prague, halir@ms.mff.cuni.cz%Created: 12.6.1997%Last modified 2.9.1997x = directions(:, 1);y = directions(:, 2);z = directions(:, 3);azimuths = atan2(y, x);elevations = atan2(z, sqrt(x .^ 2 + y .^ 2));ind = (azimuths < 0);azimuths(ind) = azimuths(ind) + 2 * pi;angles = [azimuths, elevations] / pi * 180;

⌨️ 快捷键说明

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