Questions tagged [linear-interpolation]

Linear interpolation is the process of approximating intermediate values given an assumption that the ranges of missing data look roughly like straight lines.

Linear interpolation is largely used for its simplicity and is typically more effective given a greater density of data. The more complex the underlying relationship of the quantities involved, the less likely linear interpolation is to provide a good value estimates.

In scientific software for statistical computing and graphics, function approx performs 1D linear interpolation.

437 questions
0
votes
1 answer

Plot two size vector length with xyplot

Please note that this is a simplified version (and therefore duplicate of my earlier post): https://stackoverflow.com/questions/18358694/xyplot-2-separate-data-frame-lengths It may well be that it contained too much information, however quite basic…
Maximilian
  • 4,177
  • 7
  • 46
  • 85
0
votes
1 answer

Linear Interpolation

Here is a program that asks the user for a number (variable r) to find the positive root of, and then asks for a starting interval [a,b]. This is done in some HTML code. The javascript below it has the code for linear interpolation inside a while…
0
votes
1 answer

gridded data bilinear interpolation MATLAB

I have a tabulated data which I like to use bi-linear interpolation between data (orange highlight in image) in MATLAB. I don't know how to use interp1 or interp2. if i assume that the blue row is x, and the blue column is y and the data between is…
user1331843
  • 123
  • 1
  • 6
  • 15
0
votes
1 answer

Modified linear interpolation with missing data

Imagine a set of data with given x-values (as a column vector) and several y-values combined in a matrix (row vector of column vectors). Some of the values in the matrix are not available: %% Create the test data N = 1e2; % Number of x-values x =…
Lukas
  • 2,330
  • 2
  • 22
  • 31
-1
votes
1 answer

Power Query M: List.Generate condition doesn't work between values of 4 and 16

I have a table like this: v p 3 89 3.5 178 4 328 4.5 522 5 758 5.5 1040 v goes from 3 to 24 in steps of 0.5 (v = List.Numbers(3, 43, 0.5)). p = {89, 178, 328, 522, 758, 1040, 1376, 1771, 2230, 2758, 3351, 3988, 4617, 5166,…
Katrin
  • 7
  • 3
-1
votes
2 answers

I am working in Python. I have a vector of values ranging let say from 1 to 10. I want to add missing data (zero), the value is linearly interpolated

I am working in Python. I have a vector of values ranging let say from 1 to 10. I want to add missing data (zeros), such the value is linearly interpolated: value = [2., 1., 0., 0., 0., 1., 1., 0., 0., 0.0001] I would like to get the missing values…
user17555910
-1
votes
2 answers

Why not (linearly) interpolate a matrix by matrix multiplication?

I'm a math undergrad taking linear algebra. There was a recent court case in the news that denied some video evidence because the footage was zoomed in (the data was interpolated, it "created new pixels"). This got me thinking, how would I linearly…
-1
votes
1 answer

Unity linear Interpolation for smooth 3D movement

So I am trying to create a forward running game(something like Temple Run) but I want my character to move from side-to-side smoothly and not just teleport. I tried to use Vector3.Lerp() but I just can't wrap my head around how it works. Here is…
Serban
  • 1
  • 3
-1
votes
1 answer

Is it possible to Interpolate without loop

I was wondering if it was possible to interpolate without using loop in order to earn processing time. Note : Interpolation goal is to calculate point which does not exist on my curve. For Example the rate for 9 october 2021 Curve…
TourEiffel
  • 4,034
  • 2
  • 16
  • 45
-1
votes
1 answer

requestAnimationFrame only when needed runs the animation much faster than having requestAnimationFrame all the time

I am trying to create a "smooth" animation by "lerping" the difference between an element that follows the mouse and the mouse position. This is just for demo purposes, the issue happens with scrolling events and other kinds of animations too. In…
-1
votes
1 answer

What is the dynamic solution to a linear interpolation of data in a row with missing values with an indefinite number of missing value sequences?

I have this data Date Data 8/25/2017 980 8/24/2017 64 8/23/2017 593 8/22/2017 595 8/21/2017 8/20/2017 8/19/2017 794 8/18/2017 437 8/17/2017 8/16/2017 8/15/2017 8/14/2017 629 What if i wanted (794-595)/3 in…
-1
votes
1 answer

How to evaluate or plot a SYM object?

I am working in a script for solve lagrange interpolation in matlab. I am new in it and i don't know how it works. The data for interpolation are the next X = [0 1 2 4 8] Y = [1 5 10 24 50] Then i build the polynomial od lagrange at this way: syms…
JomsDev
  • 116
  • 1
  • 9
-1
votes
1 answer

android animation with LinearInterpolator

I have some spots, which are buttons, animating vertically from top to the bottom of the screen. I have implemented the below: spot.animate().x(x2).y(y2).scaleX(SCALE_X).scaleY(SCALE_Y).setDuration(animationTime).setListener ( new…
pearmak
  • 4,979
  • 15
  • 64
  • 122
-2
votes
1 answer

Python library function to approximate a set of 2D points with a straight line

Given an array with [x, y] points, e.g.: p0 = np.random.rand(21, 2) p1 = np.array([[0, 0], [0, 1], [0, 2], [0, 3]]) I would like to get a straight line [segment] approximation of these points. Least squares method is acceptable, other error…
Paul Jurczak
  • 7,008
  • 3
  • 47
  • 72
-2
votes
1 answer

The polynomial interpolation of degree 4

For the provided data set, write equations for calculating the polynomial interpolation of degree 4 and find the formula for f by hand. x = [1, 2, 3, 4, 5] y = f(x) = [5, 31, 121, 341, 781]
1 2 3
29
30