Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8124367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T06:26:24+00:00 2026-06-06T06:26:24+00:00

I’m trying to extract euler angles from a rotation matrix. My convetions: Matrix column-major,

  • 0

I’m trying to extract euler angles from a rotation matrix.
My convetions:
Matrix column-major, Coordinate System right-handed, Positive Angle right-handed, Rotation Order YXZ (first heading, then attitude, then bank)

I’ve found this, but couldn’t use it because they use other axes orders: (http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToEuler/index.htm)

/** this conversion uses conventions as described on page:
*   http://www.euclideanspace.com/maths/geometry/rotations/euler/index.htm
*   Coordinate System: right hand
*   Positive angle: right hand
*   Order of euler angles: heading first, then attitude, then bank
*   matrix row column ordering:
*   [m00 m01 m02]
*   [m10 m11 m12]
*   [m20 m21 m22]*/
public final void rotate(matrix  m) {
    // Assuming the angles are in radians.
    if (m.m10 > 0.998) { // singularity at north pole
        heading = Math.atan2(m.m02,m.m22);
        attitude = Math.PI/2;
        bank = 0;
        return;
    }
    if (m.m10 < -0.998) { // singularity at south pole
        heading = Math.atan2(m.m02,m.m22);
        attitude = -Math.PI/2;
        bank = 0;
        return;
    }
    heading = Math.atan2(-m.m20,m.m00);
    bank = Math.atan2(-m.m12,m.m11);
    attitude = Math.asin(m.m10);
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T06:26:26+00:00Added an answer on June 6, 2026 at 6:26 am

    Ok, I solve this doing some math. I took a papper and a pen, and wrote the 3 rotation matrix (in my case: X,Y,Z). And then I multiplied them in the order I was willing to rotate (in my case: Y*X*Z).

    The resulting matrix has one of its values equal to -sinB, being B the second rotation. You can calculate the B rotation from that value. If you continue looking at the matrix, you will also notice there are 2 values equal to sinA*cosB and cosA*cosB, the division of this two values simplifies the cosB resulting in sinA/cosA that is the same as tanA, being A the first rotation. You can calculate the A rotation from that division. Similarly, you will notice sinC*cosB and cosC*cosB values.

    Finally, you need to consider the case where cosB=0 this is when B=90 or B=-90, in this case you CAN’T make the division I told before, because you will be dividing by zero! So in this case you consider B=+-90 C=0 and you calculate A from the much more simple resulting matrix.

    So this is the code I wrote for my conventinons!!

    /**
    *   Matrix column-major
    *   Coordinate System right-handed
    *   Positive Angle right-handed
    *   Rotation Order YXZ (first heading, then attitude, then bank)
    *   [m00 m01 m02]
    *   [m10 m11 m12]
    *   [m20 m21 m22]
    */
    public final void rotate(matrix  m) {
        // Assuming the angles are in radians.
        if ( m.m12 > 0.998 || m.m12 < -0.998 ) { // singularity at south or north pole
            heading = Math.atan2( -m.m20, m.m00 );
            bank = 0;
        } else {
            heading = Math.atan2( m.m02, m.m22 );
            bank = Math.atan2( m.m10, m.m11 );
        }
        attitude = Math.asin( m.m12 );
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.