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

Interpolation of a triangle

I have a unit right triangle and a value at each of the 3 vertices. I need to interpolate to find the value at a point inside the triangle. Hours of searching have turned up nothing that actually tells me how to do this. Here is my closest attempt,…
Frobot
  • 1,224
  • 3
  • 16
  • 33
17
votes
6 answers

Locate triangle containing arbitrary point in Delaunay-triangulated surface

I'm looking to do a linear interpolation of a irregularly sampled function z(x,y) based on a Delaunay triangulation. Say I have a hill for which I have obtained a Delaunay triangulation: I know the altitude z at each of the triangle vertices…
Jean-François Corbett
  • 37,420
  • 30
  • 139
  • 188
17
votes
3 answers

Best way to interpolate values in SQL

I have a table with rate at certain date : Rates Id | Date | Rate ----+---------------+------- 1 | 01/01/2011 | 4.5 2 | 01/04/2011 | 3.2 3 | 04/06/2011 | 2.4 4 | 30/06/2011 | 5 I want to get the output…
Cyril Gandon
  • 16,830
  • 14
  • 78
  • 122
17
votes
2 answers

Python pandas dataframe interpolate missing data

I have a data set like the following. We only have data for the last day of a month I am trying to interpolate rest of it, is it the right way of doing it? Date Australia China 2011-01-01 NaN NaN 2011-01-02 NaN NaN - - - - …
Unnikrishnan
  • 2,683
  • 5
  • 22
  • 39
17
votes
1 answer

Resize an image with bilinear interpolation without imresize

I've found some methods to enlarge an image but there is no solution to shrink an image. I'm currently using the nearest neighbor method. How could I do this with bilinear interpolation without using the imresize function in MATLAB?
teardrop
  • 545
  • 3
  • 9
  • 18
16
votes
5 answers

Filling gaps in a numpy array

I just want to interpolate, in the simplest possible terms, a 3D dataset. Linear interpolation, nearest neighbour, all that would suffice (this is to start off some algorithm, so no accurate estimate is required). In new scipy versions, things like…
Jose
  • 2,089
  • 2
  • 23
  • 29
16
votes
3 answers

Why doesn't smooth scroll of RecyclerView work well with some Interpolator classes?

Background In an effort to make a nice&short overview of the items on a horizontal RecyclerView, we want to have a bounce-like animation , that starts from some position, and goes to the beginning of the RecyclerView (say, from item 3 to item 0)…
android developer
  • 114,585
  • 152
  • 739
  • 1,270
16
votes
3 answers

Conversion between RGB and RYB color spaces

I am currently trying to convert colours between RGB (red, green, blue) colour space and RYB (red, yellow, blue) colour space and back again. Based on the details in the following paper, I am able to convert from RYB to RGB using trilinear…
Ben
  • 341
  • 1
  • 2
  • 9
16
votes
1 answer

*ngIf and local template variables

Could someone please explain what's behind the following behavior? Say we have an Angular 2 component that has a _model object. Then in the template we have this:
RVP
  • 2,330
  • 4
  • 23
  • 34
16
votes
4 answers

extracting a quadrilateral image to a rectangle

BOUNTY UPDATE Following Denis's link, this is how to use the threeblindmiceandamonkey code: // the destination rect is our 'in' quad int dw = 300, dh = 250; double in[4][4] = {{0,0},{dw,0},{dw,dh},{0,dh}}; // the quad in the source image is our…
Will
  • 73,905
  • 40
  • 169
  • 246
16
votes
3 answers

Java 2D weighted data interpolation

I'm trying to find some Java lib, code example (or a starting point) to help me figure out how can I interpolate a list of 2d points with a weight to generate a interpolation with level curves. Googling I figure out that there is several algorithms…
Tiago
  • 2,871
  • 4
  • 23
  • 39
15
votes
2 answers

How to do bilinear interpolation of normals over a quad?

I'm working on a Minecraft-like engine as a hobby project to see how far the concept of voxel terrains can be pushed on modern hardware and OpenGL >= 3. So, all my geometry consists of quads, or squares to be precise. I've built a raycaster to…
Thomas
  • 174,939
  • 50
  • 355
  • 478
15
votes
4 answers

Python interp1d vs. UnivariateSpline

I'm trying to port some MatLab code over to Scipy, and I've tried two different functions from scipy.interpolate, interp1d and UnivariateSpline. The interp1d results match the interp1d MatLab function, but the UnivariateSpline numbers come out…
Timothy Dees
  • 151
  • 1
  • 1
  • 3
15
votes
5 answers

How to use string interpolation in style tag in Angular component?

@Component({ selector: 'app-style', template: ` ` }) export class StyleComponent { textColor = "red"; } This doesn't seem to be working and I need my styles to be…
S. Johnson
  • 151
  • 1
  • 1
  • 3
15
votes
1 answer

How to use string interpolation in a resource file?

I would like to use a resource file to send an email. In my resource file I used a variable "EmailConfirmation" with the value "Hello {userName} ... " In my class I used: public static string message (string userName) { return…