Mike Day: Extracting Euler Angles from a Rotation Matrix

This article attempts to fix a problem which came up when implementing Ken Shoemake’s Euler angle extraction in the context of a single-precision floating point library. The original Shoemake code uses double precision, which presumably maintains sufficient precision for the problem not to arise.

euler angles.pdf (Updated 2/24/2014 with typo noted by John-Michael Fischer below fixed.)

  • John-Michael Fischer

    Hi Mike, in reviewing your pdf today I noticed there may be a typo. On page three you compute M’. The second line in the first matrix appears to confuse two coefficients. They are listed as c0 and -s0, when I believe they should be c1 and -s1. Regards.

    • Mike Day

      Thanks, John-Michael! We fixed the typo; sorry it took us a while.

  • Chris Burel

    Hi Mike,
    I’m wondering about how you calculate c2. In the pdf you have this as:
    c2 = sqrt(m[0][0]^2 + m[0][1]^2)

    However, you already know that m[0][2] is equal to -s2. So wouldn’t it be one less operation to do:
    c2 = sqrt(1 + m[0][2]^2)