Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Interpolation
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Linear interpolation=== [[File:Interpolation example linear.svg|right|thumb|230px|Plot of the data with linear interpolation superimposed]] {{Main|Linear interpolation}} One of the simplest methods is linear interpolation (sometimes known as lerp). Consider the above example of estimating ''f''(2.5). Since 2.5 is midway between 2 and 3, it is reasonable to take ''f''(2.5) midway between ''f''(2) = 0.9093 and ''f''(3) = 0.1411, which yields 0.5252. Generally, linear interpolation takes two data points, say (''x''<sub>''a''</sub>,''y''<sub>''a''</sub>) and (''x''<sub>''b''</sub>,''y''<sub>''b''</sub>), and the interpolant is given by: :<math> y = y_a + \left( y_b-y_a \right) \frac{x-x_a}{x_b-x_a} \text{ at the point } \left( x,y \right) </math> :<math> \frac{y-y_a}{y_b-y_a} = \frac{x-x_a}{x_b-x_a} </math> :<math> \frac{y-y_a}{x-x_a} = \frac{y_b-y_a}{x_b-x_a} </math> This previous equation states that the slope of the new line between <math> (x_a,y_a) </math> and <math> (x,y) </math> is the same as the slope of the line between <math> (x_a,y_a) </math> and <math> (x_b,y_b) </math> Linear interpolation is quick and easy, but it is not very precise. Another disadvantage is that the interpolant is not [[derivative|differentiable]] at the point ''x''<sub>''k''</sub>. The following error estimate shows that linear interpolation is not very precise. Denote the function which we want to interpolate by ''g'', and suppose that ''x'' lies between ''x''<sub>''a''</sub> and ''x''<sub>''b''</sub> and that ''g'' is twice continuously differentiable. Then the linear interpolation error is :<math> |f(x)-g(x)| \le C(x_b-x_a)^2 \quad\text{where}\quad C = \frac18 \max_{r\in[x_a,x_b]} |g''(r)|. </math> In words, the error is proportional to the square of the distance between the data points. The error in some other methods, including [[polynomial interpolation]] and spline interpolation (described below), is proportional to higher powers of the distance between the data points. These methods also produce smoother interpolants. {{clear}}
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)