11 #include <fmt/format.h>
12 #include <fmt/ranges.h>
14 #include <Math/DisplacementVector3D.h>
15 #include <Math/Rotation3D.h>
16 #include <Math/RotationX.h>
17 #include <Math/RotationY.h>
18 #include <Math/RotationZ.h>
23 namespace FrameTransformation {
33 static constexpr
double UTC1Ju2012 = 1341100800;
36 if (utc_time >= 1483228800)
37 TAItime = utc_time - 37;
38 else if (utc_time >= 1435708800)
39 TAItime = utc_time - 36;
40 else if (utc_time >= UTC1Ju2012)
41 TAItime = utc_time - 35;
43 TAItime = utc_time - 34;
46 double JDsec = TAItime + (2440587.5 * 86400);
59 double T = (time - 2451545.0) / 36525.0;
60 double d = (time - 2451545.0);
65 double GMST_deg = std::fmod((280.46061837 + 360.98564736629 * d + T * T * (0.000387933 - T / 38710000.0)), 360);
67 double GMSTrad = GMST_deg *
pi / 180.;
96 auto rotation = ROOT::Math::RotationZ(gmt_angle);
106 auto rotation = ROOT::Math::RotationZ(gmt_angle);
111 static constexpr
double omega = 2.0 *
pi / 86400.0;
113 result.SetCoordinates(result.X() * std::cos(gmt_angle) - result.Y() * std::sin(gmt_angle) +
114 omega * (-coo.Y() * std::cos(gmt_angle) - coo.X() * std::sin(gmt_angle)),
115 result.X() * std::sin(gmt_angle) + result.Y() * std::cos(gmt_angle) +
116 omega * (coo.X() * std::cos(gmt_angle) - coo.Y() * std::sin(gmt_angle)),
122 static constexpr
double AMS_angle = 12.0001 *
pi / 180.0;
124 auto rotation = ROOT::Math::RotationY(AMS_angle);
129 result.SetCoordinates(-1 * result.Y(), -1 * result.X(), -1 * result.Z());
137 auto roll_rotation = ROOT::Math::RotationX(ISSRoll);
138 coo = roll_rotation(coo);
141 auto pitch_rotation = ROOT::Math::RotationY(ISSPitch);
142 coo = pitch_rotation(coo);
145 auto yaw_rotation = ROOT::Math::RotationZ(ISSYaw);
146 coo = yaw_rotation(coo);
154 ISSECIPos /= std::sqrt(ISSECIPos.mag2());
155 ISSECIVel /= std::sqrt(ISSECIVel.mag2());
166 auto Z_v = ISSECIPos * -1.0;
167 auto Y_v = ISSECIVel.Cross(
168 ROOT::Math::DisplacementVector3D<ROOT::Math::Cartesian3D<double>,
RFrame<RefFrame::ECI>>{ISSECIPos});
169 Y_v /= std::sqrt(Y_v.mag2());
170 auto X_v = Y_v.Cross(ROOT::Math::DisplacementVector3D<ROOT::Math::Cartesian3D<double>,
RFrame<RefFrame::ECI>>{Z_v});
171 X_v /= std::sqrt(X_v.mag2());
175 auto R_m = ROOT::Math::Rotation3D{X_v, Y_v, Z_v};
176 TMatrixT<double> m{3, 3};
177 R_m.GetRotationMatrix(m);
186 auto rotation = ROOT::Math::RotationZ(-1.0 * gmt_angle);