Пример #1
0
 public static Polynomial AsPolynomial(this RationalFraction f)
 {
     if (f.Denom.Degree > 0)
     {
         throw new Exception(String.Format("{0} cannot be converted to polynomial !", f));
     }
     return(f.Num * (1.0 / f.Denom.Coeffs[0]));
 }
Пример #2
0
 public static RationalFraction Derivative(this RationalFraction f)
 {
     return((f.Num.Derivative() * f.Denom - f.Num * f.Denom.Derivative()) / (RationalFraction)(f.Denom * f.Denom));
 }
Пример #3
0
 public static double Eval(this RationalFraction f, double x)
 {
     return(f.Num.Eval(x) / f.Denom.Eval(x));
 }