Esempio n. 1
0
        public override double Compute(IReadOnlyDictionary <string, double> variableValues)
        {
            double arg    = Arg1.Compute(variableValues);
            double Radian = arg * Math.PI / 180;

            return(1 / Math.Tan(Radian));
        }
Esempio n. 2
0
 public override Expr Diff()
 {
     if (!IsConstant)
     {
         if (Arg1.IsConstant)
         {
             if (Arg1.Compute() == E)
             {
                 return(new FunPow(Arg1, Arg2));
             }
             else
             {
                 return(Pow(Arg1, Arg2) * Log(Arg1));
             }
         }
         else if (Arg2.IsConstant)
         {
             return(Arg2 * Pow(Arg1, Arg2 - 1));
         }
         throw new NotImplementedException();
     }
     else
     {
         return(new Constant(0));
     }
 }
Esempio n. 3
0
 public override double Compute(IReadOnlyDictionary <string, double> variableValues) =>
 Arg1.Compute(variableValues) - Arg2.Compute(variableValues);
Esempio n. 4
0
 public override double Compute(IReadOnlyDictionary <string, double> variableValues) => 1 / Math.Tanh(Arg1.Compute(variableValues));
Esempio n. 5
0
 public override double Compute(IReadOnlyDictionary <string, double> variableValues) => (Math.PI / 2 - Math.Atan(Arg1.Compute(variableValues))) * 180 / Math.PI;
Esempio n. 6
0
 public override double Compute(IReadOnlyDictionary <string, double> variableValues)
 {
     return(Arg2 == null?Math.Log(Arg1.Compute(variableValues)) : Math.Log(Arg1.Compute(variableValues), Arg2.Compute(variableValues)));
 }
Esempio n. 7
0
 public override double Compute(IReadOnlyDictionary <string, double> variableValues) => Math.Pow(Arg1.Compute(variableValues), Arg2.Compute(variableValues));