public Difference(int line, TypeDifference type, string from, string to) { Line = line; Type = type; From = from; To = to; }
public DifferentiationResult FiniteDifferenceMethod(TypeDifference typeDifference, int degreeDerivates) { List <Point> derivativePoints = new List <Point>(points); for (int i = 0; i < degreeDerivates; i++) { List <Point> tempResult = new List <Point>(); for (int j = 1; j < derivativePoints.Count - 1; j++) { if (typeDifference == TypeDifference.Left) { tempResult.Add(new Point(derivativePoints[j].X, (derivativePoints[j].Y - derivativePoints[j - 1].Y) / step)); } if (typeDifference == TypeDifference.Right) { tempResult.Add(new Point(derivativePoints[j].X, (derivativePoints[j + 1].Y - derivativePoints[j].Y) / step)); } if (typeDifference == TypeDifference.Center) { tempResult.Add(new Point(derivativePoints[j].X, (derivativePoints[j + 1].Y - derivativePoints[j - 1].Y) / (2 * step))); } } derivativePoints = tempResult; } return(new DifferentiationResult(derivativePoints.ToArray(), AbsoluteDeviation(derivativePoints), StandartDeviation(derivativePoints))); }
public Difference(TypeDifference type, string from, string to) { Type = type; From = from; To = to; }