Equation system and matrices
This article resumes what has been introduced under "cubic curve through two points" already.
The equations required to specify the coefficients may be put in a matrix, and the condition values and coefficients are vectors. The matrices are constructed from the conditions.
Ac = b
Given is vector b containing the condition values. In the case of a curve through two points with given slopes b is equal to: [y0, y1, m0, m1]
Further, x0 und x1 are given, from which the vectors v0 = [1, x0, x02, x03] and v1 = [1, x1, x12, x13] may be specified, which serve to construct the rows of matrix A:
A1 = v0 (row 1)
A2 = v1 (row 2)
A3 = [0, 1v01, 2v02, 3v03] (row 3)
A4 = [0, 1v11, 2v12, 3v13] (row 4)
By calculating the inverse of this matrix, the coefficient vector c is obtained from the matrix multiplication A-1b
Example
The image below shows a sample calculation in Excel
The tidbit: Area under the curve
Sometimes, a curve is serched enclosing a given area (F) underneath between the two end points. This condition is obtained by integrating the curve function
F = ax + b/2x2 + c/3x3 + d/4x4, at the two points:
F = ax + b(x12 - x02)/2 + c(x13 - x03)/3 + d(x14 - x04)/4
The condition is inserted in one row of matrix A, leaving one more condition to be chosen.
Comments :