关于输入度分秒转化为度的问题
自定义函数如下请参考:
Help
@language:simplified_chinese
函数qz(x)返回x的取整的值。
@end
Endh
function qz(qz1)
variable qz2
if qz1<0
qz2=-floor(abs(-qz1))
else
qz2=floor(qz1)
endif
return qz2
endf
Help
@language:simplified_chinese
函数qw(x,n)返回x的截取n位小数的值。
@end
Endh
function qw(qw1,n)
variable qw2
if qw1<0
qw2=-floor(abs(-qw1),n)
else
qw2=floor(qw1,n)
endif
return qw2
endf
Help
@language:simplified_chinese
函数 todegdms(x)返回将度分秒的x转化成度的值。
@end
Endh
function todegdms(todegdms1) //度分秒转化为度,度分秒的输入格式为 度.分秒 如1°1′0.01″ 输入 1.010001
variable todd2,todd3,todd4,todd5
todd2=qz( todegdms1)
todd3=(qw( todegdms1,2)- todd2)*100
todd4=(qw( todegdms1,6)-qw( todegdms1,2))*10000
todd5=todd2+todd3/60+todd4/3600
return todd5
endf