Say you have four points at the corners of a unit square, and each point has a value associated with it (we can use numbers here, but the solution needs to work for any continuously interpolatable value, such as RGB colors in linear space). Assuming the values are smoothly interpolated (linearly) across the space, how do you find the value of an arbitrary point inside?
My first guess is to interpolate the top two values to the horizontal component of the point, do the same with the bottom two values, and then interpolate between these two new values to the vertical component of the point. Will this work? If so, can someone explain to me why? And if not, what is the proper way?
Sorry if the terminology I used isn't correct. I'm a programmer, not a mathematician.
Edit
Right after posting this, I stumbled upon the term Bilinear Interpolation, which seems to be exactly what I was searching for. Sorry if I wasted anyone's time.
As an extension to my question, how would you do this when the four corners form an arbitrary quadrilateral? Does it depend on whether it's convex or not? What if there are more than four points?
Bilinear interpolation will do what you want when your domain is a square or even a convex quadrilateral. However, if your domain is a concave quadrilateral or even a general N-sided polygon, bilinear interpolation is no longer appropriate. You should look for articles related to Wachspress coordinates or mean value coordinates on the web. These are the barycentric coordinates against an N-sided polygon. Please find more detailed description from this link.