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

            return((int)(Fixed64.Atan2(y, (long)x << 16) >> 16));
        }
Exemplo n.º 2
0
 /// <summary>
 /// Returns the arc tan of coordinates x-y.
 /// </summary>
 public static Fixed64 Atan2(Fixed64 y, Fixed64 x)
 {
     return(Fixed64.Atan2(y, x));
 }
Exemplo n.º 3
0
 public static F64 Atan2(F64 y, F64 x)
 {
     return(FromRaw(Fixed64.Atan2(y.Raw, x.Raw)));
 }