I want to determine the rotation matrix from which compute the Euler Angles to rotate my spacecraft in order to point in a specific direction. For example, i want the z body axis of the spacecraft to be alligned with the sun vector. Therefore, I've calculated the 3 unit vectors (x,y,z) of my "pointed to the Sun" body coordinate system in an ECEF reference frame. At this point, I've used those unit vectors to write the following rotation matrix:

enter image description here

First of all, is this correct? If yes, this matrix allows to rotate a generic vector from ECEF to Body or from Body to ECEF? If not, what do you suggest? Thanks in advance!

  • 1
    $\begingroup$ Does this answer your question? math.stackexchange.com/questions/180418/… $\endgroup$ Sep 22, 2022 at 16:47
  • $\begingroup$ @Frank if you find an answer among all of those linked in Math SE that works best for you, you can post an answer here and explain which one you chose and why it works best for you (and include the bits that actually answer this question). $\endgroup$
    – uhoh
    Sep 22, 2022 at 19:38
  • $\begingroup$ Unfortunately, I already read that page and none of those answered my question. To be more specific, I need to transform the unit vectors that I have in Euler Angles (with a 123 sequence in a Fixed Coordinate System) and provide them to STK in a .a file. However there are a lot of theories out there a none of them works for now. $\endgroup$
    – Frank
    Sep 26, 2022 at 9:39

1 Answer 1


I've found a solution: if x,y and z are the unit vectors of the rotate body reference frame expressed in ECEF, the rotation matrix from Body to ECEF is the following:

enter image description here

Instead, the matrix from ECEF to body is the inverse and therefore the one that I've posted above.

From those matrix it is possible to determine the Euler Angles to rotate the satellite from one coordinate system to the other.


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.