Пример #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));
        }
Пример #2
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);
 }
Пример #3
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));
        }
Пример #4
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);
 }