1 | import circle from '@robireton/circle'
|
2 | import dataNutation from './nutation-obliquity.json'
|
3 |
|
4 |
|
5 | export default function calculateNutationAndObliquity (JDE) {
|
6 | const T = (JDE - 2451545) / 36525
|
7 | const D = circle.normalizedDegrees(297.85036 + T * (445267.111480 + T * (-0.0019142 + T / 189474)))
|
8 | const M = circle.normalizedDegrees(357.52772 + T * (35999.050340 + T * (-0.0001603 - T / 300000)))
|
9 | const M_ = circle.normalizedDegrees(134.96298 + T * (477198.867398 + T * (0.0086972 + T / 56250)))
|
10 | const F = circle.normalizedDegrees(93.27191 + T * (483202.017538 + T * (-0.0036825 + T / 327270)))
|
11 | const Ω = circle.normalizedDegrees(125.04452 + T * (-1934.136261 + T * (0.0020708 + T / 450000)))
|
12 |
|
13 | let Δψ = 0
|
14 | let Δε = 0
|
15 | for (const n of dataNutation) {
|
16 | const arg = circle.DegreesToRadians(n.D * D + n.M * M + n.M_ * M_ + n.F * F + n.Ω * Ω)
|
17 | Δψ += (n.Δψ.A + n.Δψ.B * T) * Math.sin(arg)
|
18 | Δε += (n.Δε.A + n.Δε.B * T) * Math.cos(arg)
|
19 | }
|
20 | Δψ /= 36000000
|
21 | Δε /= 36000000
|
22 |
|
23 | const U = T / 100
|
24 | const ε0 = 23 + 26 / 60 + 21.448 / 3600 + U * (-4680.93 / 3600 +
|
25 | U * (-1.55 / 3600 +
|
26 | U * (1999.25 / 3600 +
|
27 | U * (-51.38 / 3600 +
|
28 | U * (-249.67 / 3600 +
|
29 | U * (-39.05 / 3600 +
|
30 | U * (7.12 / 3600 +
|
31 | U * (27.87 / 3600 +
|
32 | U * (5.79 / 3600 +
|
33 | U * 2.45 / 3600)))))))))
|
34 |
|
35 | const ε = ε0 + Δε
|
36 |
|
37 | return {
|
38 | Δψ: Δψ,
|
39 | Δε: Δε,
|
40 | ε: ε
|
41 | }
|
42 | }
|