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

Interpolation for corresponding constant section in matlab

How to do linear interpolation for a vector corresponding to a constant section? For example we have a matrix of two column as follow. Matrix = 125.2985 5.7057 125.2991 5.7098 125.2997 5.6880 125.3004 5.6739 125.3010 5.7140 …
Umar
  • 89
  • 3
  • 10
0
votes
1 answer

Resampling and interpolate

Stuck on an assignment in understanding how to resample the data into an hourly rate instead of the 4 hour blocks they are now. Here is what has been asked to do. Differences The ENTRIES and EXITS fields hold raw counts that do not reset to zero…
user5553011
0
votes
1 answer

LibGDX: Camera lerp shakes when approaching target

I am using an Orthographic camera using a ScreenViewport with "UnitsPerPixel" set to 0.333f and when I move the play and then stop, the camera catches up as expected but then starts shaking slightly and acting weird when getting close (around the…
vedi0boy
  • 1,030
  • 4
  • 11
  • 32
0
votes
0 answers

calculating point of intersection between far or near plane and a triangle

Suppose, the near and far values of gluPerspective are 1 and 100 respectively. I want to clip the portion of the triangle having z values greater than (-near) or less than (-far) and divide the remaining polygon into two triangles like the following…
0
votes
1 answer

How can I linearly interpolate a line color if i have the start and end points and color?

I have the starting (x1, y1) and end (x2, y2), as well as their colours stored in RGBA. I need to do draw a gradient filled line between these two points, and for each point along the line, I can get the current (x, y) positions as it's in a…
0
votes
1 answer

plot graph of results within in interval in R

n=50 p=0.32 P=matrix( c(p, 1-p, 0, 0, 0, 0, p, 0, 1-p, 0, 0, 0, p, 0, 0, 1-p, 0, 0, 0, p, 0, 0, 1-p, 0, 0, 0, p, 0, 0, 1-p, 0, 0, 0, p, 0, 1-p), ncol=6, nrow=6, byrow = T) X=2 for(j in 1:n) {Y=runif(1) k=P[X[j],] k=cumsum(k) …
Ys Kee
  • 145
  • 1
  • 5
0
votes
2 answers

Interpolate between elements in an array of floats

I'm getting a list of 5 floats which I would like to use as values to send pwm to an LED. I want to ramp smoothly in a variable amount of milliseconds between the elements in the array. So if this is my array... list = [1.222, 3.111, 0.456, 9.222,…
0
votes
1 answer

OpenCV - Scale / stretch each pixel row of an image differently?

I want to upscale / stretch an image horizontally but each pixel row needs a different scale depending upon the position of the row or row-number ? I did it by cropping source image row by row int a 1 pixel high crop and then using resize to do…
Sabir Ali
  • 475
  • 2
  • 16
0
votes
1 answer

Finding values by linear interpolation in r

I have huge data that I need to find the values of several variables at a standard height. I want to interpolate linearly the values of the other variables at Height=c(0,100,200,250,400,500)and add them as new columns to the existing data. Here is…
0
votes
0 answers

Python - Interpolating problems

I am creating a program that creates a galaxy spectra for ages not specified in a given catalogue using interpolation from the nearest ages. I am trying to find a solution to make sure I am not extrapolating by adding another if statement to my…
0
votes
1 answer

How to find the fractional weighting of n colors which contribute to a known color C?

This is related to but not the same as this question (click to go to). However the linked question would need to be solved before this one, or at least the problem understood. This could be considered to be the reverse of the other. This problem is,…
0
votes
0 answers

I can't understand why I got a ValueError using interp1d form scipy.interpolate

At the first part everything is ok. I got a print: "1.5588" from scipy import interpolate x = [0., -1.7388, -1.7064, -1.6776, -1.6452, -1.6452, -1.6128, -1.584, -1.5516, -1.5192, -1.5192, -1.4868, -1.458, -1.4256, -1.3968, -1.3968, -1.3644, -1.332,…
0
votes
1 answer

c# n-linear interpolation

Wondering if I'm barking up the wrong tree. I'd like a recursive function to give me the results of an n-linear interpolation, for example: I'm applying discounts to vehicle prices. I have two types of discount: Volume and Age, such that A. Volume…
bowthy
  • 25
  • 6
0
votes
1 answer

need to use different type of interpolation? numpy interp1d

I have 2 columns of information. The 2nd column is time in seconds. The first column is error at that time. I need to make a vector that contains the value of error in seconds for 2.5s intervals. there should be 172 of them. Here is my data: col 0 =…
Maria
  • 1,247
  • 1
  • 13
  • 21
0
votes
1 answer

Interpolation of time series data with multiple samples at the same time

I am trying to interpolate my time series data so that it is on an evenly spaced time line and I am using the following code % interpolate the series t = 0 : 3 : 400; Series 1 = interp1(series 1(:,1),series 1(:,2),t,'linear'); But this error…
Tina
  • 23
  • 6