度分秒转化成弧度的函数代码Public Function RAD(ByVal DEGREE As String) As DoubleDim G As StringDim G1 As DoubleDim d As BooleanDim DEG11 As DoubleDim DEG12 As DoubleDim DEG13 As DoubleDEGREE = DEGFORMAT(DEGREE)G = Left(Trim(Left(DEGREE, 3

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/05 20:49:34

度分秒转化成弧度的函数代码Public Function RAD(ByVal DEGREE As String) As DoubleDim G As StringDim G1 As DoubleDim d As BooleanDim DEG11 As DoubleDim DEG12 As DoubleDim DEG13 As DoubleDEGREE = DEGFORMAT(DEGREE)G = Left(Trim(Left(DEGREE, 3
度分秒转化成弧度的函数代码
Public Function RAD(ByVal DEGREE As String) As Double
Dim G As String
Dim G1 As Double
Dim d As Boolean
Dim DEG11 As Double
Dim DEG12 As Double
Dim DEG13 As Double
DEGREE = DEGFORMAT(DEGREE)
G = Left(Trim(Left(DEGREE, 3)), 1)
If G = "-" Then
G1 = -1
ElseIf G = "+" Then
G1 = 1
Else
G1 = 1
End If
DEG11 = Abs(Val(Left(DEGREE, 4)))
DEG12 = Val(Mid(DEGRE, 6, 2))
DEG12 = Val(Mid(DEGRE, 6, 2)) / 60
DEG13 = Val(Right(DEGREE, Len(DEGREE) - 8)) / 3600
RAD = G1 * (DEG11 + DEG12 + DEG13) * PI() / 180
End Function
上面这段代码里面,DEGREE = DEGFORMAT(DEGREE)这一句是什么意思?怎么理解?

度分秒转化成弧度的函数代码Public Function RAD(ByVal DEGREE As String) As DoubleDim G As StringDim G1 As DoubleDim d As BooleanDim DEG11 As DoubleDim DEG12 As DoubleDim DEG13 As DoubleDEGREE = DEGFORMAT(DEGREE)G = Left(Trim(Left(DEGREE, 3
DEGREE = DEGFORMAT(DEGREE)
这是一个赋值语句,就是把DEGREE作为函数 DEGFORMAT的参数,调用DEGFORMAT,最后把得到的值赋给DEGREE