Extract rotation angles from the rotation matrix.Namespace: AForge.Math
Assembly: AForge.Math (in AForge.Math.dll) Version: 188.8.131.52 (184.108.40.206)
Note:The routine assumes roll-pitch-yaw rotation order when extracting rotation angle. Using extracted angles with the CreateFromYawPitchRoll(Single, Single, Single) should provide same rotation matrix.
Note:The method assumes the provided matrix represent valid rotation matrix.
// assume we have a rotation matrix created like this float yaw = 10.0f / 180 * Math.PI; float pitch = 30.0f / 180 * Math.PI; float roll = 45.0f / 180 * Math.PI; Matrix4x4 rotationMatrix = Matrix3x3.CreateFromYawPitchRoll( yaw, pitch, roll ); // ... // now somewhere in the code you may want to get rotation // angles back from a matrix assuming same rotation order float extractedYaw; float extractedPitch; float extractedRoll; rotation.ExtractYawPitchRoll( out extractedYaw, out extractedPitch, out extractedRoll );