Ejemplo n.º 1
0
        public static int AcosFast(int x)
        {
            // Return 0 for invalid values
            if (x < -One || x > One)
            {
                FixedUtil.InvalidArgument("Fixed32.AcosFast", "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.SqrtFast(xx);

            return((int)(Fixed64.Atan2Fast(y, (long)x << 16) >> 16));
        }
Ejemplo n.º 2
0
 public static F64 Atan2Fast(F64 y, F64 x)
 {
     return(FromRaw(Fixed64.Atan2Fast(y.Raw, x.Raw)));
 }