|
楼主 |
发表于 2018-11-25 13:51
|
显示全部楼层
Sub 按钮1_Click()
Dim arr, k0, brr(), crr
k0 = [a1].End(4).Row - 1
arr = [a2].Resize(k0, 1)
ReDim brr(1 To k0, 1 To 4)
crr = [f1].Resize(k0 + 1, 11)
Dim z() As Double, i
Dim y1 As Long, m1 As Integer, d1 As Integer
For i = 1 To k0
''''''''''''''儒略日转换
ymd = Split(arr(i, 1), "-")
y1 = ymd(0): m1 = ymd(1): d1 = ymd(2)
brr(i, 1) = GL2JD(y1, m1, d1) - 8 / 24 + deltaT(y1) / 86400
testT = (brr(i, 1) - 2451545#) / 365250 '儒略千年数
''''''''''''''计算太阳坐标
ReDim z(0 To 2)
Call earthCoor(testT, z, -1) '地球黄经
z(0) = z(0) + pai: z(1) = -z(1) '太阳黄经黄纬 //太阳地心黄经 = 地球日心黄经 + 180°
brr(i, 2) = z(0)
gx = gxc_sun(testT, z(0)) '太阳光行差
nu = nutation(testT * 10) '章动计算
nu2 = Split(nu, ",")
z(0) = z(0) + (nu2(0) + gx) / (rad * 3600) '补章动与光行差
E = hcjj(testT) + nu2(1) / (rad * 3600) '得到真黄赤交角
Call HCconv(z, E) '转到赤道坐标
brr(i, 3) = rad2str(rad2mrad(z(0)), 1) '视赤经
temp = rad2mrad(z(1))
brr(i, 4) = rad2str(temp * 1, 0) '视赤纬
For j = 1 To 11
crr(i + 1, j) = ACos4(Tan(temp * 1) * Tan(crr(1, j) / rad)) / pai
crr(i + 1, j) = Round((1 - crr(i + 1, j)) * 24, 2)
Next
Next
[b2].Resize(k0, 4) = brr
[f1].Resize(k0 + 1, 11) = crr
End Sub
|
评分
-
1
查看全部评分
-
|