taraddms.m

来自「功能极全的GPS开发工具箱」· M 代码 · 共 22 行

M
22
字号
%                                taraddms.m
%  Scope:   This MATLAB macro converts an angle value from radians to 
%           degrees/minutes/seconds.
%  Usage:   [adeg,amin,asec] = taraddms(arad)
%  Description of parameters:
%           arad -  input, angle in radians
%           adeg -  output, angle - degrees component
%           amin -  output, angle - minutes component
%           asec -  output, angle - seconds component
%  Last update:  04/04/00
%  Copyright (C) 1996-00 by LL Consulting. All Rights Reserved.

function  [adeg,amin,asec] = taraddms(arad)

temp = 180. * abs(arad) / pi;
adeg = fix(temp);
temp = 60. * (temp - adeg);
amin = fix(temp);
asec = 60. * (temp - amin);
if arad < 0.
   adeg = - adeg;
end

⌨️ 快捷键说明

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