Does anyone know of a good C or fortran library which constructs the rotation matrix to convert from ECI to ECEF components?

  • $\begingroup$ Related: space.stackexchange.com/q/32146/26741 $\endgroup$
    – cms
    Commented Jun 22, 2019 at 0:52
  • $\begingroup$ IAUSOFA (noted below) and CSPICE are the big/well-known libraries in this area $\endgroup$
    – user7073
    Commented Jun 24, 2019 at 3:32

1 Answer 1



The IAU’s Standards of Fundamental Astronomy (SOFA) library has a ANSI C and FORTRAN version.

See the documentation on the C2T06A function for converting from ECI to ECEF.

You must look up what are called Earth Orientation Parameters (EOP) if you wish to convert ECI coordinates to ECEF. You can find them here.

  • 1
    $\begingroup$ So in IAU language, ECEF is the same as ITRS and ECI is GCRS ? $\endgroup$
    – vibe
    Commented Jun 22, 2019 at 2:34
  • $\begingroup$ In the IAU language, ECEF and ECI do not exist per se. But to the spirit of your question, yes, ITRS is the equivalent of ECEF, and GCRS is the equivalent of ECI. Note that the IAU frames move differently than the simplified models, so check with your customer what frames they need. $\endgroup$
    – ChrisR
    Commented Jun 22, 2019 at 4:47
  • $\begingroup$ Ok thanks. In the C2T06A function, it needs a $x_p,y_p$ in put defined as the coordinates in radians of the Celestial Intermediate Pole wrt ITRS, but I cannot find any routine which actually gives me these numbers. I have looked through IERS documention also with no success. The routine xy06.c computes "CIP $x,y$ coordinates" but doesn't say which coordinate system it is - is this the correct function to use? $\endgroup$
    – vibe
    Commented Jun 22, 2019 at 5:02
  • $\begingroup$ $x_p$ and $y_p$ are what are called Earth Orientation Parameters (EOP) and are derived from actual measurements. In other words, you will need to get them from a lookup table based on an epoch. In the United States, the NGA publishes EOP parameters. See earth-info.nga.mil/GandG/update/… $\endgroup$
    – cms
    Commented Jun 22, 2019 at 12:10
  • $\begingroup$ That NGA site only has data until 2016. I found another site, for example hpiers.obspm.fr/iers/eop/eopc04/eopc04.15, but its not clear to me if the $x,y$ in that data file is the same as $x_p,y_p$. The guide document in that same directory says they are "pole coordinates", but doesn't specifically mention the Celestial Intermediate Pole. Are they different things? $\endgroup$
    – vibe
    Commented Jun 22, 2019 at 15:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.