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
5
votes
3 answers

How to build a lookup table in C (SDCC compiler) with linear interpolation

For a LPC922 microcontroller (with SDCC) I want to create a lookup table with linear interpolation. Lets assume I got x and y values like x=300 y=10,0201 x=700 y=89,542 x=800 y=126,452 x=900 y=171,453 x=1500 y=225,123 How can the code for a…
Stefan
  • 53
  • 1
  • 1
  • 3
5
votes
1 answer

How can I use d3-scale-chromatic functions with a domain other than [0, 1]?

Here's my code: var color = d3.scaleLinear() .domain([0, 10000]) .interpolate(d3.interpolateBlues); console.log(color(5000)); Instead of telling me that 5000 corresponds to a light blue, I get the error "r0 is not a function". What am I…
Alex Henrie
  • 744
  • 1
  • 6
  • 17
5
votes
5 answers

Linear interpolation in direct digital synthesis

I'm working on a microcontroller DDS project in C and am having some trouble figuring out how to compute a linear interpolation to smooth the output values. The program as it stands now uses the top 8 bits of a 24 bit accumulator as an index to an…
MattyZ
  • 1,541
  • 4
  • 24
  • 41
5
votes
1 answer

Pandas Interpolate dataframe with new length

I have a dataframe with columns of Datetime, lat, lon, z. I am reading the data in from a csv file so setting the period for the datetimes do not work. The times are in 6 hour intervals but I want to linearly interpolate the data to hourly…
BenT
  • 3,172
  • 3
  • 18
  • 38
5
votes
1 answer

How can i produce multi point linear interpolation?

I have a linear interpolation methods. This is calculate interpolate value when (x1,y1) (x2,y2) and x0 known. it is calculate y0 value. But i need the do that when multi point known. I am not talking about Bilinear or Trilinear interpolation.
EmreS
  • 159
  • 1
  • 3
  • 15
5
votes
1 answer

How to implement linear interpolation method in java array?

I am working on a simple linear interpolation program. And I am having some troubles when implementing the algorithm. Assuming there are 12 numbers as a whole, we'll let user input 3 of them(position 0, position 6 and position 12). Then the program…
turf
  • 183
  • 2
  • 2
  • 16
5
votes
1 answer

SQL Server Interpolate Missing rows

I have the following table which records a value per day. The problem is that sometimes days are missing. I want to write a SQL query that will: Return the missing days Calculate the missing value using linear interpolation So from the following…
SausageFingers
  • 1,796
  • 5
  • 31
  • 52
5
votes
2 answers

Unity3D Slerp rotation speed

I'm using Unity3D. I'd like to rotate an object to face the direction of the mouse pointer, but allow a maximum rotation speed, like "max 100 degrees per second". There is an example in the doc, but it does not do what I want. I think the Time.time…
Agostino
  • 2,723
  • 9
  • 48
  • 65
5
votes
3 answers

Interpolation advice (linear, cubic?)

I need to find good approximations of the points where an undefined function intersect a threshold value. I'm stepping through my space and whenever I find that two subsequent steps are on different sides of the threshold, I add a point somewhere in…
David Rutten
  • 4,716
  • 6
  • 43
  • 72
4
votes
3 answers

Linear Interpolation to find coord in triangle

Suppose you have the following three points A, B, and C as shown in the following picture: The points are always sorted according to their vertical offset, so the top most point is always A. Sometimes B and C could have the same y coordinate. I'm…
rodrigo-silveira
  • 12,607
  • 11
  • 69
  • 123
4
votes
0 answers

PyTorch grid_sample for 2D tensors

I have a 3D tensor data of shape (N, W, D) and another 1D tensor index of shape (B,). I need to sample data using index such that my output should be of shape (B,N,D). That is, for every element of index, I need to linearly interpolate data along…
Nagabhushan S N
  • 6,407
  • 8
  • 44
  • 87
4
votes
1 answer

How would I make a color Gradient with linear interpolation along with Linked list?

I am currently trying to make a rainbow trail that follows your mouse. i used Linkedlist to plot the points of my mouse so the trail follows along. The trail itself looks perfect its only the colors in the trail that don't look right. I'm wanting…
Ryan - Llaver
  • 528
  • 4
  • 19
4
votes
3 answers

How can I perform linear interpolation using oracle SQL?

I am trying to use Oracle 11g (11.1 in dev, 11.2 in production) for numeric analysis, specifically linear interpolation on a table which has three columns of interest: a timestamp, a deviceid, and value. The value columns holds data from the device…
GLaDOS
  • 683
  • 1
  • 14
  • 29
4
votes
2 answers

Expand time series data in pandas dataframe

I am attempting to interpolate between time points for all data in a pandas dataframe. My current data is in time increments of 0.04 seconds. I want it to be in increments of 0.01 seconds to match another data set. I realize I can use the…
4
votes
1 answer

Pandas interpolation type when method='index'?

The pandas documentation indicates that when method='index', the numerical values of the index are used. However, I haven't found any indication of the underlying interpolation method employed. It looks like it uses linear interpolation. Can…
rhz
  • 960
  • 14
  • 29
1 2
3
29 30