Exemplo n.º 1
0
        public static float Pitch(Quaternion q)
        {
            float3 v = q.ydir();

            return((float)Math.Atan2(v.z, Math.Sqrt(v.x * v.x + v.y * v.y)) * (180.0f / 3.14159264f));
        }
Exemplo n.º 2
0
        public static float Yaw(Quaternion q)
        {
            float3 v = q.ydir();

            return((v.y == 0.0 && v.x == 0.0) ? 0.0f : (float)Math.Atan2(-v.x, v.y) * (180.0f / 3.14159264f));
        }