Understanding of linear interpolation

【Interpolation】

Interpolation is a method of using known points to find unknown points, and usually two known points are used to find an unknown point. (If many known points are used to find unknown points, curve fitting is generally used)

Since two known points are used to find an unknown point, the distance between the two known points should be as small as possible, so that the unknown point obtained will be as accurate as possible.

The reason why "known point" is used instead of "known value" is because a known point can be a one-dimensional point represented by one value, or a two-point point represented by two values, or three values Represents a 3D point.

What does it mean that the distance between two straight points should be as small as possible, it depends on the specific situation

If A=1, B=100, the unit is m, in the case of a city map, it is relatively large; in the case of a country map, the distance between two points is very small.

【Linear interpolation】

If there is an unknown point between two points, if we don't know how the point between the two points changes, we usually think that it changes linearly, that is, linearly interpolate the two points to get the third point .

The method of linear interpolation is as follows:

 The interpolation coefficient can be directly regarded as a weight coefficient, and the value range is between 0 and 1.

[Different usages of linear interpolation]

Regardless of the usage, the Y value in the formula does not need to be a value. Y can be a two-dimensional coordinate, a three-dimensional coordinate, a vector, a matrix, or even a picture, a video, a set of data, etc.

1. Only need to give an interpolation coefficient

Sometimes we don't care about the specific X. In this case, we don't need to know x0, x1, as long as we have y0, y1, we can take any suitable value for the interpolation coefficient.

2. Need to know specific X

In some problems, a specific x is required, and after a specific X is given, it is equivalent to determining a specific interpolation coefficient. Usually this kind of problem will be more obvious.

3. Use linear interpolation to make linear changes

This requires linear interpolation to calculate a series of unknown points between two points, as long as the interpolation coefficient changes linearly, such as 0.1, 0.2, 0.3, 0.4 and so on.

4. Use linear interpolation to make nonlinear changes

This requires linear interpolation to calculate a series of unknown points between two points, as long as the interpolation coefficient changes linearly, such as 0.01, 0.1, 0.22, 0.56 and so on.

5. Linear approximation with linear interpolation

Keep the interpolation parameters unchanged, each time the point that appears in the interpolation is used as a new y0, approaching y1

6. Nonlinear approximation with linear interpolation

Nonlinearly varying interpolation parameters

Guess you like

Origin blog.csdn.net/enternalstar/article/details/126770803