private PlusSign[] ReturnNewtonIndeterminates(int order) { PlusSign[] funcs = new PlusSign[order + 1]; HNode hNode = new HNode(); NaturalNumberNode orderNode; MultiplicationSign multiplicationSign; VariableNode variableNode = new VariableNode(); for (int i = 0; i <= order; i++) { orderNode = new NaturalNumberNode(order - i); multiplicationSign = new MultiplicationSign(orderNode, hNode); funcs[i] = new PlusSign(variableNode, multiplicationSign); } return(funcs); }
public double ReturnNewtonDerivative(double x) { HNode hNode = new HNode(); return((Calculate(x + hNode.Calculate(x)) - Calculate(x)) / hNode.Calculate(x)); }
private double CalculatePolynomialDerivative(double x, int order) { HNode hNode = new HNode(); return(ReturnNewtonPolynomial(x, order).Calculate(x) / Math.Pow(hNode.Calculate(x), order)); }