public static __t.Name__ FastAtan2(__t.Name__ y, __t.Name__ x)
        {
            __t.Name__ angle;
            double     piThreeFourths = Constant.Pi * 3 / 4;
            double     yAbs           = y.Abs() + Constant <double> .PositiveTinyValue; // prevent 0/0 condition

            if (x >= 0)
            {
                double r = (x - yAbs) / (x + yAbs);
                angle = __cast__(Constant.PiQuarter * (1 - r));
            }
            else
            {
                double r = (x + yAbs) / (yAbs - x);
                angle = __cast__(piThreeFourths - Constant.PiQuarter * r);
            }

            return(y < 0 ? -angle : angle); // negate if in quad III or IV
        }
 public static bool IsTiny(this __t.Name__ x, __t.Name__ epsilon)
 => x.Abs() < epsilon;
示例#3
0
 public static bool IsTiny(this __t.Name__ x, __t.Name__ epsilon)
 {
     return(x.Abs() < epsilon);
 }
 public static bool IsTiny(this __t.Name__ x)
 => x.Abs() < Constant <__t.Name__> .PositiveTinyValue;
示例#5
0
 public static bool IsTiny(this __t.Name__ x)
 {
     return(x.Abs() < Constant <__t.Name__> .PositiveTinyValue);
 }