技术文栏 - 其它文档 - 电脑应用 - 浏览文章 - 测量中常用的角度转换(CAD程序)Lisp
测量中常用的角度转换(CAD程序)Lisp
http://17grow.com 2005-7-2 3:40:00
测量中常用的角度转换(CAD程序)Lisp

Public Const M_SEC# = 206264.8
Public Const M_DEG# = 57.2957795130823
Public Const M_RAD# = 1.74532925199433E-02
Public Const M_PI# = 3.14159265358979

Public Function Rad(ByVal angle As Double) As Double
Dim a As Double, B As Double, c As Double, d As Double
Dim ang As Double, sign As Integer
ang = Abs(angle) + 0.0000000000001: sign = Sgn(angle)
a = Int(ang): B = (ang - a) * 100#: c = Int(B): d = (B - c) * 100#
Rad = sign * (a + c / 60# + d / 3600#) * M_RAD
End Function

Public Function Dms(ByVal radian As Double) As Double
Dim a As Double, B As Double, c As Double, d As Double, e As Double
Dim ang As Double, sign As Integer
ang = Abs(radian) + 0.00000000000001: sign = Sgn(radian): a = ang * M_DEG
B = Int(a): c = (a - B) * 60: d = Int(c): e = (c - d) * 60
Dms = sign * (B + d / 100# + e / 10000#)
End Function

1/1页次 第1页
所属分类: 其它文档 - 电脑应用   所属专题:
共有 3297 人次浏览 收藏本页 返回上一页 责任编辑:
相关文章