Exemple #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));
        }
Exemple #2
0
 public static F64 Atan2Fastest(F64 y, F64 x)
 {
     return(FromRaw(Fixed64.Atan2Fastest(y.Raw, x.Raw)));
 }