Exemplo n.º 1
0
        public static int AcosFastest(int x)
        {
            // Return 0 for invalid values
            if (x < -One || x > One)
            {
                FixedUtil.InvalidArgument("Fixed32.AcosFastest", "x", x);
                return(0);
            }

            // Compute Atan2(Sqrt((1+x) * (1-x)), x), using s32.32.
            long xx = (long)(One + x) * (long)(One - x);
            long y  = Fixed64.SqrtFastest(xx);

            return((int)(Fixed64.Atan2Fastest(y, (long)x << 16) >> 16));
        }
Exemplo n.º 2
0
 public static F64 LengthFastest(F64Vec4 a)
 {
     return(F64.FromRaw(Fixed64.SqrtFastest(Fixed64.Mul(a.RawX, a.RawX) + Fixed64.Mul(a.RawY, a.RawY) + Fixed64.Mul(a.RawZ, a.RawZ) + Fixed64.Mul(a.RawW, a.RawW))));
 }
Exemplo n.º 3
0
 public static F64Vec4 SqrtFastest(F64Vec4 a)
 {
     return(new F64Vec4(Fixed64.SqrtFastest(a.RawX), Fixed64.SqrtFastest(a.RawY), Fixed64.SqrtFastest(a.RawZ), Fixed64.SqrtFastest(a.RawW)));
 }
Exemplo n.º 4
0
 public static F64Vec3 SqrtFastest(F64Vec3 a)
 {
     return(new F64Vec3(Fixed64.SqrtFastest(a.RawX), Fixed64.SqrtFastest(a.RawY), Fixed64.SqrtFastest(a.RawZ)));
 }
Exemplo n.º 5
0
 public static F64 SqrtFastest(F64 a)
 {
     return(FromRaw(Fixed64.SqrtFastest(a.Raw)));
 }
Exemplo n.º 6
0
 public static F64Vec2 SqrtFastest(F64Vec2 a)
 {
     return(new F64Vec2(Fixed64.SqrtFastest(a.RawX), Fixed64.SqrtFastest(a.RawY)));
 }
Exemplo n.º 7
0
 public static F64 LengthFastest(F64Vec2 a) { return F64.FromRaw(Fixed64.SqrtFastest(Fixed64.Mul(a.RawX, a.RawX) + Fixed64.Mul(a.RawY, a.RawY))); }
Exemplo n.º 8
0
 public static F32 LengthFastest(F32Vec3 a)
 {
     return(F32.FromRaw((int)(Fixed64.SqrtFastest((long)a.RawX * (long)a.RawX + (long)a.RawY * (long)a.RawY + (long)a.RawZ * (long)a.RawZ) >> 16)));
 }