yzt
2023-05-26 2f70f6727314edd84d8ec2bfe3ce832803f1ea77
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
29
30
31
32
33
34
import { Iau2000Orientation } from "../../Source/Cesium.js";
import { IauOrientationAxes } from "../../Source/Cesium.js";
import { JulianDate } from "../../Source/Cesium.js";
import { Math as CesiumMath } from "../../Source/Cesium.js";
import { Matrix3 } from "../../Source/Cesium.js";
import { TimeStandard } from "../../Source/Cesium.js";
 
describe("Core/IauOrientationAxes", function () {
  it("compute ICRF to Moon Fixed", function () {
    var date = new JulianDate(2451545.0, -32.184, TimeStandard.TAI);
    var axes = new IauOrientationAxes(Iau2000Orientation.ComputeMoon);
 
    // expected results taken from STK Components:
    //    EvaluatorGroup group = new EvaluatorGroup();
    //    IauOrientationAxes axes = new IauOrientationAxes(Iau2000Orientation.ComputeMoon);
    //    AxesEvaluator eval1 = axes.GetEvaluator(group);
    //    UnitQuaternion q = eval1.Evaluate(TimeConstants.J2000);
    //    Matrix3By3 expectedMatrix = new Matrix3By3(q);
    var expectedMatrix = new Matrix3(
      0.784227052091917,
      0.55784711246016394,
      0.27165148607559436,
      -0.62006191525085563,
      0.7205566654668133,
      0.31035675134719942,
      -0.022608671404182448,
      -0.41183090094261243,
      0.91097977859342938
    );
 
    var mtx = axes.evaluate(date);
    expect(mtx).toEqualEpsilon(expectedMatrix, CesiumMath.EPSILON13);
  });
});