PDA

View Full Version : Interpolation in 3D


geetha
10-23-2007, 05:48 AM
I have two known points (x1, y1, z1) and (x2, y2, z2) which lie on a straight line in space. I want to find z corresponding to x and y, where x lies between x1 and x2, y lies between y1 and y2.
Can someone help me out???

Identity
10-23-2007, 11:21 AM
z1 < z < z2, or z1 > z > z2.

HallsofIvy
10-25-2007, 02:16 PM
The straight line from (x1, y1, z1) to (x2,y2,z2) can be parametetrized by
x= x1+ t(x2-x1), y= y1+ t(y2-y1), z= z1+ t(z2-z1). For a given x, you can solve x= x1+ t(x2-x1) for t= (x-x1)/(x2-x1). If the given y does not then satisfy y= y1+ t(y2-y1) for THAT t, there is no value of z such that (x,y,z) lies on the straight line between (x1,y1,z1) and (x2, y2, z2) so you cannot use LINEAR interpolation. There are, then, an infinite number of non-linear interpolation methods you could use. You would have to decide which you wanted to use.