Interpolation help fitting curve to three points

  • Thread starter KV-1
  • Start date
  • #1
16
1

Main Question or Discussion Point

Hello,

I have the following points that need to be fitted with a curve:
(1,20);(2,4);(5,3)

I'm wondering how to use the http://en.wikipedia.org/wiki/Lagrange_polynomial to do this.

If possible, can these points be fitted with a cubic function?

I tried to fit a cubic to this, but for me it's a game of guess and check which won't give me anything efficiently.
 

Answers and Replies

  • #2
hotvette
Homework Helper
990
3
There are infinitely many cubic polynomial equations that will go through three points, but only one quadratic (i.e. parabola). You can use example 3 as a guide in the link you provided, or write out three quadratic equations by substituting the values you have for x and y. In the end you'll have 3 equations with 3 unknowns (i.e. the coefficients of the parabola) that can be solved using substitution.
 
Last edited:
  • #3
HallsofIvy
Science Advisor
Homework Helper
41,806
932
And the Lagrange polynomial formula gives that quadratic, not a cubic.

The given points are (1,20), (2,4), and (5,3).
[tex]20\frac{(x- 2)(x- 5)}{(1- 2)(1- 3)}+ 4\frac{(x- 1)(x- 5)}{(2- 1)(2- 5)}+ 3\frac{(x- 1)(x- 2)}{(5- 1)(5- 2)}[/tex]
[tex]= 20\frac{(x- 2)(x- 5)}{2}+ 4\frac{(x-1)(x-5)}{-3}+ 3\frac{(x-1)(x-2)}{12}[/tex]
 
  • #4
13
0
And the Lagrange polynomial formula gives that quadratic, not a cubic.

The given points are (1,20), (2,4), and (5,3).
[tex]20\frac{(x- 2)(x- 5)}{(1- 2)(1- 3)}+ 4\frac{(x- 1)(x- 5)}{(2- 1)(2- 5)}+ 3\frac{(x- 1)(x- 2)}{(5- 1)(5- 2)}[/tex]
[tex]= 20\frac{(x- 2)(x- 5)}{2}+ 4\frac{(x-1)(x-5)}{-3}+ 3\frac{(x-1)(x-2)}{12}[/tex]

Hallsofivy, i think there's a mistake.. the bold one..


20(x−2)(x−5)/(1−2)(1−5)+4(x−1)(x−5)/(2−1)(2−5)+3(x−1)(x−2)/(5−1)(5−2)

it is 5, not 3 right?
 

Related Threads on Interpolation help fitting curve to three points

Replies
5
Views
1K
  • Last Post
Replies
5
Views
14K
  • Last Post
Replies
2
Views
2K
  • Last Post
Replies
4
Views
4K
  • Last Post
Replies
5
Views
667
  • Last Post
Replies
1
Views
2K
Replies
2
Views
2K
Replies
3
Views
11K
  • Last Post
Replies
1
Views
1K
Top