How To: Transform between the Earth Centered Fixed and Earth Centered Inertial reference frames

This is the first in what I hope will be a series of short "how to" articles on accomplishing specific tasks with AGI Components.

In this article, I will show how to use Dynamic Geometry Library to compute the rotation between the Earth Centered Fixed (ECF) and Earth Centered Inertial (ECI) reference frames.


In the image above, the red lines represent the ECF reference frame while the blue lines represent the ECI reference frame. Given a point or vector defined in one of the reference frames, we can find it in the other reference frame. It's important to note that the ECI and ECF frames moves with respect to each other. So a point that is stationary in the ECI frame is moving in the ECF frame, and vice-versa.

We'll need the following using declarations for the code to follow:

using AGI.Foundation.Coordinates;
using AGI.Foundation.Celestial;
using AGI.Foundation.Geometry;
using AGI.Foundation.Time;

Dynamic Geometry Library's ReferenceFrame class represents a reference frame. Various predefined reference frames can be obtained from the central body instances in the CentralBodiesFacet. So, our first step is to obtain the Earth:

EarthCentralBody earth = CentralBodiesFacet.GetFromContext().Earth;

Next, we obtain the ECF and ECI reference frames from the Earth instance:

ReferenceFrame ecf = earth.FixedFrame;
ReferenceFrame eci = earth.InertialFrame;

The GeometryTransformer static class will help us obtain an evaluator for transforming between the two reference frames. In this case, we want a transformation from the ECF frame to the ECI frame:

ReferenceFrameEvaluator evaluator =
    GeometryTransformer.GetReferenceFrameTransformation(ecf, eci);

Because these two references frames move relative to each other, the transformation between them changes with time. So we must evaluate the transformation at a specific time:

JulianDate now = new JulianDate(DateTime.UtcNow);
KinematicTransformation transformation =

We can then use this KinematicTransformation to transform a point or vector, represented as a Cartesian instance, between the reference frames:

Cartesian somePositionEcf = new Cartesian(9127571.4, 8009590.78, 7325222.9);
Cartesian somePositionEci = transformation.Transform(somePositionEcf);

A KinematicTransformation contains both the rotational and translational components of the transformation. Since the ECF and ECI frames are both centered at Earth's center of mass, there is no translational component. The Rotation property provides just the rotation between the frames, and it can easily be converted to other rotational transformation representations support by Dynamic Geometry Library:

UnitQuaternion rotation = transformation.Rotation;
Matrix3By3 rotationAsMatrix = new Matrix3By3(rotation);

For more information, see the Reference Frames and Transformations overview in the documentation.

4 Responses to “How To: Transform between the Earth Centered Fixed and Earth Centered Inertial reference frames”

  • Great article Kevin, thanks for doing the “How-Tos”. The transformation from ECI to ECF requires information on pole wander and time offsets, typically contained in an Earth Orientation Parameter file (EOP). You didn’t mention it in the article, but there must be some way to bring this in for the transformation – true?

  • Ted:

    When you define the central body in

    EarthCentralBody earth = CentralBodiesFacet.GetFromContext().Earth;

    the EarthCentralBody object has the means to include the EOP file. You can do this in the following manner…

    1. Read the EOP file into an EarthOrientationParameters object
    EarthOrientationParameters eop =
    EarthOrientationParametersFile.ReadData(¨path to file name¨);

    2. Assign that object to the OrientationParameters property of the EarthCentralBody

    This should get things started, at least.
    earth.OrientationParameters = eop;

  • Which frame rotates with the earth and which does not? I can guess. But I need to be 100% sure, not 90%. The API docs didn’t help.

  • Stan, the fixed frame is fixed to the Earth and rotates with it, so the Earth appears stationary. In the inertial frame, the Earth appears to spin.

Comments are currently closed.