sorry if this is a basic problem but I don't know where to start looking.

Imagine two perpendicular lines ("profiles") in a "$T$" spatial arrangement. The lines are arbitrary (empirical functions should I say?) in the sense that they don't follow any simple formula (but I have the data of each line, for example they could be height of terrain along a 10 km transect, with data every 500 m). One line is parallel to the $X$ axis, the other is parallel to the $Y$ axis. These lines have one point in common, ie there is one value where $Xi=Yi$.

I would like to interpolate between them to guess how the area would look like. So I want to go from 2 known lines (1D) to a surface (2D).

I imagine that I need a function $Z=f(X,Y)$ such as when plotting this function I can have a 2D representation of the surface containing both lines ("profiles")

For simplicity, it is OK if: - The interpolation is the simplest (linear?) - The lines are perpendicular (but it would be nice to have a solution for any given angle)

I am sure this must be a VERY common problem in many many fields... But I don't know the math world.. Could you please provide some keywords so I start looking??

Thanks very very much!!!

Edit (25-7-2013):

I'm not sure if I explained myself correctly, so I made a couple of plots to illustrate my points. The lines are NOT straight lines (except when viewed from above). Imagine you measure the height of the terrain over two lines: one from A to B, another from C to D. When viewed from above, these lines are perpendicular and they have a point in common: they look like this: https://www.dropbox.com/s/z92j3ae417kp65u/1d.lines.png

Note that the point they have in common is the beginning of one line, and the middle of the 2nd line.

Now, what I need is an algorithm which allows me to "guess" the surface defined by these two lines. I would think on a simple interpolation, but how? I need to obtain this: https://www.dropbox.com/s/3is8zzetps4coq3/surface.png


Your lines must intersect to determine a plane; skew lines don't define a plane. But if they do intersect, then produce 3 non-collinear points $(x_1,y_1,z_1)$, $(x_2,y_2,z_2)$, $(x_3,y_3,z_3)$. In general, you will have a planar equation of the form $z = ax + by + c$ (except for the special case of a vertical plane). Your coefficients are the 3 unknowns, and you have three points. Using these 3 points, you can solve for your coefficients and get an equation for your plane.

Since you have two different lines, you can choose any two points on one of the lines, and a third point on the other line; you do not need to use their point of intersection. For convenience, try taking as many of the coordinates to be zero as possible.

In practical applications, your data will not be this nice. You will have a number of points scattered throughout space, not all lying on the same plane. Every three of these determines a plane, so it's typical to form a triangular mesh by repeatedly applying the above method for each local triplet. It's also more common to form two vectors and take a cross product to get a normal to the plane, and to write it in point-normal form; you may want to look into that method after you're comfortable with the one I mentioned above, especially if you're already familiar with vectors and the cross product.

Update: Now that I see the actual situation you have, your question is not basic at all. In fact, you have almost no hope of getting what I think you want out of your data. Your interpolated guess in the second figure is not likely close to the truth, but it also not the worst thing you could do with your data. I don't know what algorithm you used (or your software used) to get the interpolation, but there are other ways to guess the value of your function at the missing points. You should read the various methods outlined at http://en.wikipedia.org/wiki/Multivariate_interpolation. This is not my area of expertise, so maybe someone else will weigh in, but I think that you can probably find a method there that produces results that you prefer to the interpolation you already have, and also with some parameters that let you fine-tune the results. I think you'll probably end up with, at best, a very bad guess for the missing data, especially if you want to interpolate far from either of the curves. You will also need to choose a discrete subset of your curves to employ most of the methods, but I think you probably already have a discrete dataset that you used to produce them in the first place.

  • $\begingroup$ It looks to me that I would get a plane surface with your solution, but I need something more complicated, I think.Since I'm not sure that I explained myself correctly, I added more detain and graphics to my question. I would tend to think that the solution is a little more complicated than you suggest, but by no means I am an expert so I just would like be sure that my explanation is clear (now). $\endgroup$ – terauser Jul 25 '13 at 11:30
  • $\begingroup$ I've updated my answer based on your update. I can't help you, specifically, more than to point you to the salient part of Wikipedia (which does address your question directly, and gives you a lot of different types of interpolation to try out). I am pretty confident in saying that you can't do better than choosing your favorite from among the types of interpolation mentioned there. $\endgroup$ – Eric Tressler Jul 28 '13 at 18:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.