Questions tagged [interpolation]

Anything related to function interpolation, i.e. the mathematical techniques for estimating the (unknown) value of a function in a point on the basis of a set of known values in other (usually nearby) points. For interpolation of strings, see the [string-interpolation] tag.

Anything related to function interpolation, i.e. the mathematical techniques for estimating the (unknown) value of a function in a point on the basis of a set of known values in other (usually nearby) points.

See Wikipedia on interpolation.

In scientific software for statistical computing and graphics, function approx implements linear interpolation and function spline implements cubic spline interpolation.

For interpolation of strings, see .

5155 questions
43
votes
1 answer

How to scale images on a html5 canvas with better interpolation?

First of all: what am I trying to do? I have an application to view images. It uses the canvas element to render the image. You can zoom in, you can zoom out, and you can drag it around. This part works perfectly right now. But let's say I have an…
Kumpu
  • 433
  • 1
  • 4
  • 5
41
votes
5 answers

interpolate 3D volume with numpy and or scipy

I am extremely frustrated because after several hours I can't seem to be able to do a seemingly easy 3D interpolation in python. In Matlab all I had to do was Vi = interp3(x,y,z,V,xi,yi,zi) What is the exact equivalent of this using scipy's…
user1301295
  • 674
  • 1
  • 6
  • 15
41
votes
3 answers

How do I make angular.js reevaluate / recompile inner html?

I'm making a directive that modifies it's inner html. Code so far: .directive('autotranslate', function($interpolate) { return function(scope, element, attr) { var html = element.html(); debugger; html =…
kornfridge
  • 5,102
  • 6
  • 28
  • 40
40
votes
3 answers

How can I separate Perl variables from text in interpolated strings?

Consider: print " $foo", "AAAAAAAA", $foo, "BBBBBBBB"; Let's say I want to use this code with a print <
Julien
  • 5,729
  • 4
  • 37
  • 60
38
votes
2 answers

`ValueError: A value in x_new is above the interpolation range.` - what other reasons than not ascending values?

I receive this error in scipy interp1d function. Normally, this error would be generated if the x was not monotonically increasing. import scipy.interpolate as spi def refine(coarsex,coarsey,step): finex =…
durbachit
  • 4,626
  • 10
  • 36
  • 49
36
votes
3 answers

Use another I18n key in an I18n interpolation

This might be I18n-ception but lets say I have an en.yml file as below en: my_var: Foo my_message: "This is a message where I'd like to interpolate I18n's %{my_var}" Is there a way to indicate to I18n that %{my_var} should be the my_var key in…
Aaron
  • 13,349
  • 11
  • 66
  • 105
35
votes
10 answers

Rotation Interpolation

NB: I'll present this question in degrees purely for simplicity, radians, degrees, different zero-bearing, the problem is essentially the same. Does anyone have any ideas on the code behind rotational interpolation? Given a linear interpolation…
Rob
  • 1,687
  • 3
  • 22
  • 34
33
votes
8 answers

How to perform cubic spline interpolation in python?

I have two lists to describe the function y(x): x = [0,1,2,3,4,5] y = [12,14,22,39,58,77] I would like to perform cubic spline interpolation so that given some value u in the domain of x, e.g. u = 1.25 I can find y(u). I found this in SciPy but I…
user112829
  • 491
  • 1
  • 4
  • 7
33
votes
2 answers

Get the minimal surface solution of a 3D contour

I have a set of 3D points defining a 3D contour. What I want to do is to obtain the minimal surface representation corresponding to this contour (see Minimal Surfaces in Wikipedia). Basically, this requires to solve a nonlinear partial differential…
32
votes
9 answers

In Ruby, can you perform string interpolation on data read from a file?

In Ruby you can reference variables inside strings and they are interpolated at runtime. For example if you declare a variable foo equals "Ted" and you declare a string "Hello, #{foo}" it interpolates to "Hello, Ted". I've not been able to…
Teflon Ted
  • 8,696
  • 19
  • 64
  • 78
32
votes
3 answers

Generate colors between red and green for an input range

Possible Duplicate: Color coding based on number I want for a user to be able to select from a range from 1-100, where as the numbers become less than 50, the color of the area becomes darker green, and as the color becomes closer to 100, the…
Naftali
  • 144,921
  • 39
  • 244
  • 303
31
votes
9 answers

How to perform bilinear interpolation in Python

I would like to perform blinear interpolation using python. Example gps point for which I want to interpolate height is: B = 54.4786674627 L = 17.0470721369 using four adjacent points with known coordinates and height values: n = [(54.5, 17.041667,…
daikini
  • 1,307
  • 6
  • 23
  • 36
31
votes
2 answers

Multivariate spline interpolation in python/scipy?

Is there a library module or other straightforward way to implement multivariate spline interpolation in python? Specifically, I have a set of scalar data on a regularly-spaced three-dimensional grid which I need to interpolate at a small number of…
Chris P
  • 503
  • 1
  • 4
  • 7
31
votes
3 answers

Pandas interpolate within a groupby

I've got a dataframe with the following information: filename val1 val2 t 1 file1.csv 5 10 2 file1.csv NaN NaN 3 file1.csv 15 20 6 file2.csv NaN NaN 7 file2.csv 10 20 8 …
R. W.
  • 357
  • 1
  • 5
  • 9
31
votes
4 answers

How do I choose an image interpolation method? (Emgu/OpenCV)

The image resizing function provided by Emgu (a .net wrapper for OpenCV) can use any one of four interpolation methods: CV_INTER_NN (default) CV_INTER_LINEAR CV_INTER_CUBIC CV_INTER_AREA I roughly understand linear interpolation, but can only…
Tom Wright
  • 11,278
  • 15
  • 74
  • 148