FiniteCalculusGetDifference Method Mathos Core Library 1.0.5.1 (changeset 39720)
This documentation is compiled for the latest release of Mathos Core Library
Finds the difference between terms in a sequence. By chaging the degree, we can take difference of the differences.

Namespace: Mathos.Calculus
Assembly: Mathos (in Mathos.dll) Version: 1.0.5.1 (1.0.5.1)
Syntax

public static double GetDifference(
	double[] sequence,
	int term,
	int degree
)

Parameters

sequence
Type: SystemDouble
The sequence of doubles passed in as a double array.
term
Type: SystemInt32
The index of the first term where the diff. should be taken. NB: As the degree increases, the smaller can the term be
degree
Type: SystemInt32
The type of difference, i.e. if degree=1, the first difference is taken and if degree=2, the difference of the first difference is taken.

Return Value

Type: Double
The difference between the terms in the sequence, depending on the degree.
Examples

If the sequence is {1,2,3,4,...}, term=0, degree=1, we get 1. By changning degree=2, we get 0.
See Also

Reference