Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Interpolation
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
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}}
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Interpolation
(section)
Add topic