示例#1
0
文件: Math.cs 项目: nstepan/Fraction
        private static double ToRadians(double x, DegRadGrad drg)
        {
            double result = 0;

            switch (drg)
            {
            case DegRadGrad.Deg:
                result = DegreeConverter.DegToRad(x);
                break;

            case DegRadGrad.Rad:
                result = x;
                break;

            case DegRadGrad.Grad:
                result = DegreeConverter.GradToRad(x);
                break;

            default:
                Debug.Assert(false, "Parametar should be Deg, Rad or Grad");
                break;
            }

            return(result);
        }
示例#2
0
文件: Math.cs 项目: nstepan/Fraction
 public static double Acsch(double x, DegRadGrad drg)
 {
     return(FromRadians(Asinh(1 / x, drg), drg));
 }
示例#3
0
文件: Math.cs 项目: nstepan/Fraction
 public static double Atanh(double x, DegRadGrad drg)
 {
     return(FromRadians(Math.Log((1 + x) / (1 - x)) / 2, drg));
 }
示例#4
0
文件: Math.cs 项目: nstepan/Fraction
 public static double Asech(double x, DegRadGrad drg)
 {
     return(FromRadians(Acosh(1 / x, drg), drg));
 }
示例#5
0
文件: Math.cs 项目: nstepan/Fraction
 public static double Csch(double x, DegRadGrad drg)
 {
     return(2.0 / (Math.Pow(Math.E, ToRadians(x, drg)) - Math.Pow(Math.E, -ToRadians(x, drg))));
 }
示例#6
0
文件: Math.cs 项目: nstepan/Fraction
 public static double Acosh(double x, DegRadGrad drg)
 {
     return(FromRadians(Math.Log(x + Math.Sqrt(x * x - 1)), drg));
 }
示例#7
0
文件: Math.cs 项目: nstepan/Fraction
 public static double Tanh(double x, DegRadGrad drg)
 {
     return(Math.Tanh(ToRadians(x, drg)));
 }
示例#8
0
文件: Math.cs 项目: nstepan/Fraction
 public static double Coth(double x, DegRadGrad drg)
 {
     return(Cosh(ToRadians(x, drg), drg) / Sinh(ToRadians(x, drg), drg));
 }
示例#9
0
文件: Math.cs 项目: nstepan/Fraction
 public static double Acsc(double x, DegRadGrad drg)
 {
     return(FromRadians(Math.Asin(1.0 / x), drg));
 }
示例#10
0
文件: Math.cs 项目: nstepan/Fraction
 public static double Asec(double x, DegRadGrad drg)
 {
     return(FromRadians(Math.Acos(1.0 / x), drg));
 }
示例#11
0
文件: Math.cs 项目: nstepan/Fraction
 public static double Atan2(double y, double x, DegRadGrad drg)
 {
     return(FromRadians(Math.Atan2(y, x), drg));
 }
示例#12
0
文件: Math.cs 项目: nstepan/Fraction
 public static double Csc(double x, DegRadGrad drg)
 {
     return(1.0 / Math.Sin(ToRadians(x, drg)));
 }
示例#13
0
文件: Math.cs 项目: nstepan/Fraction
 public static double Sec(double x, DegRadGrad drg)
 {
     return(1.0 / Math.Cos(ToRadians(x, drg)));
 }