Search code examples
c#algorithmkinect

How to convert a Matrix4 or Quaternion to angle in degrees


I'm asking if anyone could help me in converting a Matrix4 or Quaternion to angle in degrees, I'm working on Kinect windows SDK 1.5 using C#, the sdk 1.5 provides the joint orientation but only in Matrix4 or Quaternion and i need the angles in degrees.


Solution

  • Well, the numbers in quaternions and matrix4 are cosines. Therefore, the following functions solves it:

    Function cs_a_gr(cose)
        Return 180 / PI * Acos(cose)
    End Function