Linear Interpolation

Cummings

I have a problem where I need to work out a value of a specific point that lies in the quadrilateral that is formed by four seperate points.

For each point that makes up the quadrilateral, I know the X and Y coordinates and their value, Z. For the point I am trying to find the value for, I only know the X and Y coordinates.

I want to use linear interpolation to determine the value at that point, yet am not sure of the best mathematical technique to do it. For simplicity, I can assume that the quadrilateral is, for lack of a better term, 'squareish' - no inner angle is more than 180 degrees. The four points are also given in clockwise order.

I have thought about using some simple line equations to do this, where I take the point and find the equation of the line that passes through one of the quadrilateral points. I then find the equations of the lines that form the quadrilateral and find the point where the original line intersects with one of the quadrilateral lines. I can interpolate the value at this point and then use that interpolated value to interpolate the value at the point I need.

Would this technique work or is there a better one. The most important aspect is that if the point lies on a known value, it takes that value. For all other points, it needs to be interpolated.

Last edited by a moderator:

fresh_42

Mentor
2018 Award
As I understand it, there is a surface in three dimensional spaces which contains the quadrilateral. The crucial point are not the angles, but the shape of the surface. In case it is flat you can simply calculate the plane equation and evaluate it at the given inner point. In any other case the surface could be quite arbitrary and additional information is needed about how the $z-$values are distributed.

"Linear Interpolation"

Physics Forums Values

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving