Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Interpolation help fitting curve to three points

  1. Nov 28, 2011 #1

    I have the following points that need to be fitted with a curve:

    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.
  2. jcsd
  3. Nov 28, 2011 #2


    User Avatar
    Homework Helper

    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: Nov 28, 2011
  4. Nov 28, 2011 #3


    User Avatar
    Science Advisor

    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]
  5. Nov 29, 2011 #4

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


    it is 5, not 3 right?
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook