summaryrefslogtreecommitdiffstats
path: root/org/madore/ephem/Precession.java
blob: 33453c560c326e40cf303c34cad24956a3ae339d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package org.madore.ephem;

public final class Precession {

    // The following angles are in arcseconds, argument is in Julian centuries since J2000.
    // Source: IERS Conventions 2010, §5.6.4
    public static final double epsilon0 = 84381.406;
    public static Comput.Polynomial psi
	= new Comput.Polynomial(0, 5038.481507, -1.0790069, -0.00114045, 0.000132851, -0.0000000951); 
    public static Comput.Polynomial omega
	= new Comput.Polynomial(epsilon0, -0.025754, 0.0512623, -0.00772503, -0.000000467, 0.0000003337);
    public static Comput.Polynomial chi
	= new Comput.Polynomial(0, 10.556403, -2.3814292, -0.00121197, 0.000170663, -0.0000000560);
    public static Comput.Polynomial epsilon
	= new Comput.Polynomial(epsilon0, -46.836769, -0.0001831, 0.00200340, -0.000000576, -0.0000000434);
    public static Comput.Polynomial eqorg
	= new Comput.Polynomial(0.014506, 4612.156534, 1.3915817, -0.00000044, -0.000029956, -0.0000000368);

    public static Frames.Rotation matrix(double t) {
	// Transform J2000 ecliptic coordinates to mean equatorial coordinates of date.
	// Frames.Rotation mat1 = Frames.Rotation.rotx(epsilon0*Comput.arcsecond);
	Frames.Rotation mat2 = Frames.Rotation.rotz(-psi.v(t)*Comput.arcsecond);
	Frames.Rotation mat3 = Frames.Rotation.rotx(-omega.v(t)*Comput.arcsecond).apply(mat2);
	Frames.Rotation mat4 = Frames.Rotation.rotz(chi.v(t)*Comput.arcsecond).apply(mat3);
	return mat4;
    }

}