|
Find the equation of an order n polynomial that passes through n pointsOn 6/1/01 6:31:47 PM, Garrett Mckinnon wrote:
I think you want to fit an order n polynomial to n points. Here's the method. I'll illustrate with a fourth-order polynomial, although it can be used for any n. Suppose you know the following points (x,f(x)):
There is some polynomial,
that satisfies these five points. Since that's true, you can take any point -- I'll use the first one -- and set x equal to -2, and f(x) is 85. So you have
Simplifying, we have
Using the same procedure with the second point, we get
Doing the same calculations on the remaining three points, we get
Now here's something unexpected: we have five linear equations with five unknowns. The surprise is that the unknown isn't x, but rather a, b, c, d, and e. These five letters normally represent constant coefficients, but in this case, we don't know what they are. So to us, they're unknowns. x, on the other hand, is perfectly well known, at least for the five points we were given. Make sure you have gotten past the shock of the knowns and unknowns switching places before you go on. Are you OK? Let's continue. So we have five equations with five unknowns:
Cramer's method works well for solving these (especially if you have a darned good method for finding determinants of large matrices!) The coefficient matrix has a determinant of 21600. When the first column of the coefficient matrix is replaced by the constants, the determinant becomes 64800, so
By replacing each column of the coefficient matrix in turn by the constants, we find the values of b, c, d, and e the same way.
This is a good method for finding all sorts of curves given a number of points. For example, you can use a similar method to find the equation of a circle that passes through any three points. The only difference is the general form of the equation should be the one for a circle instead of the one for a polynomial. Related pages in this website
|
|
The webmaster and author of the Math
Help site is Graeme McRae. |