|
|
@ -1,9 +1,10 @@
|
|
|
|
package planet
|
|
|
|
package planet
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
import (
|
|
|
|
"math"
|
|
|
|
|
|
|
|
. "b612.me/astro/tools"
|
|
|
|
. "b612.me/astro/tools"
|
|
|
|
|
|
|
|
"math"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
func WherePlanet(xt, zn int, jd float64) float64 {
|
|
|
|
func WherePlanet(xt, zn int, jd float64) float64 {
|
|
|
|
var XL0 [][]float64
|
|
|
|
var XL0 [][]float64
|
|
|
|
XL0 = [][]float64{
|
|
|
|
XL0 = [][]float64{
|
|
|
@ -141,7 +142,6 @@ func WherePlanet(xt, zn int, jd float64) float64 {
|
|
|
|
/*R4*/ 1202, 1.4150, 220.4126, 708, 1.162, 213.299, 516, 6.240, 206.186, 427, 2.469, 7.114, 268, 0.187, 426.598, 170, 5.959, 199.072, 150, 0.480, 433.712, 145, 1.442, 227.526, 121, 2.405, 14.227, 47, 5.57, 639.90, 19, 5.86, 647.01, 17, 0.53, 440.83, 16, 2.90, 110.21, 15, 0.30, 419.48, 14, 1.30, 412.37, 13, 2.09, 323.51, 11, 0.22, 95.98, 11, 2.46, 117.32, 10, 3.14, 0.00, 9, 1.56, 88.87, 9, 2.28, 21.34, 9, 0.68, 216.48, 8, 1.27, 234.64, 8, 4.49, 853.20, 8, 3.59, 302.16, 6, 5.17, 103.09, 5, 2.59, 515.46, 4, 4.97, 860.31, 4, 0.02, 191.96, 4, 5.97, 654.12, 4, 1.60, 330.62, 4, 1.60, 405.26, 4, 3.30, 210.12, 3, 2.73, 522.58, 3, 0.75, 209.37, 3, 1.32, 728.76, 2, 1.19, 124.43, 2, 0.49, 447.94, 2, 3.28, 203.00, 2, 0.73, 625.67, 2, 6.15, 429.78, 2, 0.75, 295.05, 2, 3.89, 1066.50, 2, 2.00, 831.86, 2, 0.09, 942.06, 2, 0.82, 223.59, 2, 1.40, 224.34, 2, 3.02, 184.84, 2, 5.41, 824.74, 2, 5.96, 422.67, 1, 2.12, 529.69, 1, 0.72, 536.80, 1, 1.65, 17.41, 1, 1.90, 956.29, 1, 5.97, 195.14, 1, 1.12, 838.97, 1, 0.89, 721.65, 1, 1.59, 735.88, 1, 3.06, 1574.85, 1, 1.01, 1045.15, 1, 5.36, 316.39, 1, 4.93, 56.62, 1, 2.72, 508.35, 1, 1.11, 1169.59,
|
|
|
|
/*R4*/ 1202, 1.4150, 220.4126, 708, 1.162, 213.299, 516, 6.240, 206.186, 427, 2.469, 7.114, 268, 0.187, 426.598, 170, 5.959, 199.072, 150, 0.480, 433.712, 145, 1.442, 227.526, 121, 2.405, 14.227, 47, 5.57, 639.90, 19, 5.86, 647.01, 17, 0.53, 440.83, 16, 2.90, 110.21, 15, 0.30, 419.48, 14, 1.30, 412.37, 13, 2.09, 323.51, 11, 0.22, 95.98, 11, 2.46, 117.32, 10, 3.14, 0.00, 9, 1.56, 88.87, 9, 2.28, 21.34, 9, 0.68, 216.48, 8, 1.27, 234.64, 8, 4.49, 853.20, 8, 3.59, 302.16, 6, 5.17, 103.09, 5, 2.59, 515.46, 4, 4.97, 860.31, 4, 0.02, 191.96, 4, 5.97, 654.12, 4, 1.60, 330.62, 4, 1.60, 405.26, 4, 3.30, 210.12, 3, 2.73, 522.58, 3, 0.75, 209.37, 3, 1.32, 728.76, 2, 1.19, 124.43, 2, 0.49, 447.94, 2, 3.28, 203.00, 2, 0.73, 625.67, 2, 6.15, 429.78, 2, 0.75, 295.05, 2, 3.89, 1066.50, 2, 2.00, 831.86, 2, 0.09, 942.06, 2, 0.82, 223.59, 2, 1.40, 224.34, 2, 3.02, 184.84, 2, 5.41, 824.74, 2, 5.96, 422.67, 1, 2.12, 529.69, 1, 0.72, 536.80, 1, 1.65, 17.41, 1, 1.90, 956.29, 1, 5.97, 195.14, 1, 1.12, 838.97, 1, 0.89, 721.65, 1, 1.59, 735.88, 1, 3.06, 1574.85, 1, 1.01, 1045.15, 1, 5.36, 316.39, 1, 4.93, 56.62, 1, 2.72, 508.35, 1, 1.11, 1169.59,
|
|
|
|
/*R5*/ 129, 5.913, 220.413, 32, 0.69, 7.11, 27, 5.91, 227.53, 20, 4.95, 433.71, 20, 0.67, 14.23, 14, 2.67, 206.19, 14, 1.46, 199.07, 13, 4.59, 426.60, 7, 4.63, 213.30, 5, 3.61, 639.90, 4, 4.90, 440.83, 3, 4.07, 647.01, 3, 4.66, 191.96, 3, 0.49, 323.51, 3, 3.18, 419.48, 2, 3.70, 88.87, 2, 3.32, 95.98, 2, 0.56, 117.32, 2, 5.33, 302.16, 2, 0.00, 0.00, 2, 2.67, 853.20, 2, 0.86, 515.46, 1, 5.83, 234.64, 1, 0.16, 412.37, 1, 5.98, 3.18, 1, 5.23, 216.48, 1, 5.05, 124.43, 1, 0.37, 28.45},
|
|
|
|
/*R5*/ 129, 5.913, 220.413, 32, 0.69, 7.11, 27, 5.91, 227.53, 20, 4.95, 433.71, 20, 0.67, 14.23, 14, 2.67, 206.19, 14, 1.46, 199.07, 13, 4.59, 426.60, 7, 4.63, 213.30, 5, 3.61, 639.90, 4, 4.90, 440.83, 3, 4.07, 647.01, 3, 4.66, 191.96, 3, 0.49, 323.51, 3, 3.18, 419.48, 2, 3.70, 88.87, 2, 3.32, 95.98, 2, 0.56, 117.32, 2, 5.33, 302.16, 2, 0.00, 0.00, 2, 2.67, 853.20, 2, 0.86, 515.46, 1, 5.83, 234.64, 1, 0.16, 412.37, 1, 5.98, 3.18, 1, 5.23, 216.48, 1, 5.05, 124.43, 1, 0.37, 28.45},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Dura精度:J2000+-4千年 黄经1角秒 黄纬1角秒 距离20AU/10^6
|
|
|
|
//Dura精度:J2000+-4千年 黄经1角秒 黄纬1角秒 距离20AU/10^6
|
|
|
|
[]float64{
|
|
|
|
[]float64{
|
|
|
|
100000000, //A的倍率
|
|
|
|
100000000, //A的倍率
|
|
|
@ -183,42 +183,40 @@ func WherePlanet(xt, zn int, jd float64) float64 {
|
|
|
|
/*R1*/ 236339, 0.704980, 38.133036, 13220, 3.32015, 1.48447, 8622, 6.2163, 35.1641, 2702, 1.8814, 39.6175, 2155, 2.0943, 2.9689, 2153, 5.1687, 76.2661, 1603, 0.0000, 0.0000, 1464, 1.1842, 33.6796, 1136, 3.9189, 36.6486, 898, 5.241, 388.465, 790, 0.533, 168.053, 760, 0.021, 182.280, 607, 1.077, 1021.249, 572, 3.401, 484.444, 561, 2.887, 498.671, 490, 3.468, 137.033, 271, 3.274, 71.813, 264, 0.862, 4.453, 204, 2.418, 32.195, 155, 0.365, 41.102, 133, 3.602, 9.561,
|
|
|
|
/*R1*/ 236339, 0.704980, 38.133036, 13220, 3.32015, 1.48447, 8622, 6.2163, 35.1641, 2702, 1.8814, 39.6175, 2155, 2.0943, 2.9689, 2153, 5.1687, 76.2661, 1603, 0.0000, 0.0000, 1464, 1.1842, 33.6796, 1136, 3.9189, 36.6486, 898, 5.241, 388.465, 790, 0.533, 168.053, 760, 0.021, 182.280, 607, 1.077, 1021.249, 572, 3.401, 484.444, 561, 2.887, 498.671, 490, 3.468, 137.033, 271, 3.274, 71.813, 264, 0.862, 4.453, 204, 2.418, 32.195, 155, 0.365, 41.102, 133, 3.602, 9.561,
|
|
|
|
/*R2*/ 4247, 5.8991, 38.1330, 218, 0.346, 1.484, 163, 2.239, 168.053, 156, 4.594, 182.280, 127, 2.848, 35.164, 118, 5.103, 484.444, 112, 1.190, 498.671, 99, 3.42, 175.17, 77, 0.02, 491.56, 65, 3.46, 388.47, 50, 4.07, 76.27, 39, 6.10, 1021.25, 37, 5.97, 2.97, 36, 5.17, 137.03,
|
|
|
|
/*R2*/ 4247, 5.8991, 38.1330, 218, 0.346, 1.484, 163, 2.239, 168.053, 156, 4.594, 182.280, 127, 2.848, 35.164, 118, 5.103, 484.444, 112, 1.190, 498.671, 99, 3.42, 175.17, 77, 0.02, 491.56, 65, 3.46, 388.47, 50, 4.07, 76.27, 39, 6.10, 1021.25, 37, 5.97, 2.97, 36, 5.17, 137.03,
|
|
|
|
/*R3*/ 166, 4.552, 38.133},
|
|
|
|
/*R3*/ 166, 4.552, 38.133},
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sata := 0
|
|
|
|
sata := 0
|
|
|
|
if(xt==-1){
|
|
|
|
if xt == -1 {
|
|
|
|
xt=0;
|
|
|
|
xt = 0
|
|
|
|
sata=1;
|
|
|
|
sata = 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
rad := 180.0000 * 3600.0000 / math.Pi
|
|
|
|
rad := 180.0000 * 3600.0000 / math.Pi
|
|
|
|
|
|
|
|
|
|
|
|
n:=-1;
|
|
|
|
n := -1
|
|
|
|
t := (jd - 2451545) / 36525.0000
|
|
|
|
t := (jd - 2451545) / 36525.0000
|
|
|
|
t /= 10 //转为儒略千年数
|
|
|
|
t /= 10 //转为儒略千年数
|
|
|
|
|
|
|
|
|
|
|
|
tn := float64(1)
|
|
|
|
tn := float64(1)
|
|
|
|
F :=XL0[xt];
|
|
|
|
F := XL0[xt]
|
|
|
|
pn := zn*6 + 1
|
|
|
|
pn := zn*6 + 1
|
|
|
|
N0 := F[pn+1]-F[pn]; //N0序列总数
|
|
|
|
N0 := F[pn+1] - F[pn] //N0序列总数
|
|
|
|
var N, v float64
|
|
|
|
var N, v float64
|
|
|
|
for i := 0; i < 6; i++ {
|
|
|
|
for i := 0; i < 6; i++ {
|
|
|
|
n1 := F[pn+i]
|
|
|
|
n1 := F[pn+i]
|
|
|
|
n2 := F[pn+1+i]
|
|
|
|
n2 := F[pn+1+i]
|
|
|
|
n0 := n2 - n1
|
|
|
|
n0 := n2 - n1
|
|
|
|
if(n0==0) {
|
|
|
|
if n0 == 0 {
|
|
|
|
continue
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(n<0) {
|
|
|
|
if n < 0 {
|
|
|
|
N = n2 //确定项数
|
|
|
|
N = n2 //确定项数
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
N = math.Floor(3*float64(n)*n0/N0+0.5) + n1
|
|
|
|
N = math.Floor(3*float64(n)*n0/N0+0.5) + n1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(i!=0) {
|
|
|
|
if i != 0 {
|
|
|
|
N += 3
|
|
|
|
N += 3
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(N > n2) {
|
|
|
|
if N > n2 {
|
|
|
|
N = n2
|
|
|
|
N = n2
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -226,14 +224,14 @@ func WherePlanet(xt, zn int, jd float64) float64 {
|
|
|
|
for j := n1; j < N; j += 3 {
|
|
|
|
for j := n1; j < N; j += 3 {
|
|
|
|
c += F[int(j)] * math.Cos(F[int(j)+1]+t*F[int(j)+2])
|
|
|
|
c += F[int(j)] * math.Cos(F[int(j)+1]+t*F[int(j)+2])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
v += c*tn;
|
|
|
|
v += c * tn
|
|
|
|
tn *= t
|
|
|
|
tn *= t
|
|
|
|
}
|
|
|
|
}
|
|
|
|
v /= F[0]
|
|
|
|
v /= F[0]
|
|
|
|
|
|
|
|
|
|
|
|
if xt == 0 { //地球
|
|
|
|
if xt == 0 { //地球
|
|
|
|
t2 := t * t
|
|
|
|
t2 := t * t
|
|
|
|
t3:=t2*t; //千年数的各次方
|
|
|
|
t3 := t2 * t //千年数的各次方
|
|
|
|
if zn == 0 {
|
|
|
|
if zn == 0 {
|
|
|
|
v += (-0.0728 - 2.7702*t - 1.1019*t2 - 0.0996*t3) / rad
|
|
|
|
v += (-0.0728 - 2.7702*t - 1.1019*t2 - 0.0996*t3) / rad
|
|
|
|
} else if zn == 1 {
|
|
|
|
} else if zn == 1 {
|
|
|
@ -251,8 +249,8 @@ func WherePlanet(xt, zn int, jd float64) float64 {
|
|
|
|
-0.25486, +0.00276, +0.42926, //土星
|
|
|
|
-0.25486, +0.00276, +0.42926, //土星
|
|
|
|
+0.24588, +0.00345, -14.46266, //天王星
|
|
|
|
+0.24588, +0.00345, -14.46266, //天王星
|
|
|
|
-0.95116, +0.02481, +58.30651, //海王星
|
|
|
|
-0.95116, +0.02481, +58.30651, //海王星
|
|
|
|
};
|
|
|
|
}
|
|
|
|
dv := XL0_xzb[ (xt-1)*3+zn ];
|
|
|
|
dv := XL0_xzb[(xt-1)*3+zn]
|
|
|
|
if zn == 0 {
|
|
|
|
if zn == 0 {
|
|
|
|
v += -3 * t / rad
|
|
|
|
v += -3 * t / rad
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -277,9 +275,8 @@ func WherePlanet(xt, zn int, jd float64) float64 {
|
|
|
|
if xt > 0 && zn == 1 {
|
|
|
|
if xt > 0 && zn == 1 {
|
|
|
|
return (v * 180 / math.Pi)
|
|
|
|
return (v * 180 / math.Pi)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (xt>0 && zn==0){
|
|
|
|
if xt > 0 && zn == 0 {
|
|
|
|
return (Limit360(v * 180 / math.Pi))
|
|
|
|
return (Limit360(v * 180 / math.Pi))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return v
|
|
|
|
return (v)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|