Skip to main content

eulerAnglesFromMatrix

Functions

coeff(mat4, row_index, column_index)number
eulerAnglesFromMatrix(res, m4, a0, a1, a2)

\returns the Euler-angles of the rotation matrix \c *this using the convention defined by the triplet (\a a0,\a a1,\a a2)

Each of the three parameters \a a0,\a a1,\a a2 represents the respective rotation axis as an integer in 2. For instance, in: \code Vector3f ea = mat.eulerAngles(2, 0, 2); \endcode "2" represents the z axis and "0" the x axis, etc. The returned angles are such that we have the following equality: \code mat == AngleAxisf(ea[0], Vector3f::UnitZ()) * AngleAxisf(ea[1], Vector3f::UnitX()) * AngleAxisf(ea[2], Vector3f::UnitZ()); \endcode This corresponds to the right-multiply conventions (with right hand side frames).

The returned angles are in the ranges [0:pi]x[-pi:pi]x[-pi:pi]. NOTE: ported from Eigen C++ library

coeff(mat4, row_index, column_index) ⇒ number

Kind: global function

ParamType
mat4Array.<number>
row_indexnumber
column_indexnumber

eulerAnglesFromMatrix(res, m4, a0, a1, a2)

\returns the Euler-angles of the rotation matrix \c *this using the convention defined by the triplet (\a a0,\a a1,\a a2)

Each of the three parameters \a a0,\a a1,\a a2 represents the respective rotation axis as an integer in {0,1,2}. For instance, in: \code Vector3f ea = mat.eulerAngles(2, 0, 2); \endcode "2" represents the z axis and "0" the x axis, etc. The returned angles are such that we have the following equality: \code mat == AngleAxisf(ea[0], Vector3f::UnitZ())

 * AngleAxisf(ea[1], Vector3f::UnitX())
* AngleAxisf(ea[2], Vector3f::UnitZ()); \endcode

This corresponds to the right-multiply conventions (with right hand side frames).

The returned angles are in the ranges [0:pi]x[-pi:pi]x[-pi:pi]. NOTE: ported from Eigen C++ library

Kind: global function
See

ParamTypeDescription
resArray.<number>
m4Array.<number> | Float32Array | mat4
a0numberaxis index
a1numberaxis index
a2numberaxis index