• 14
• 12
• 9
• 10
• 13

# Interpolation

This topic is 3720 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi I know the forumla for basic linear interpolation is: x0 + (s * (x1 - x0)). I cannot for the life of me remember how to extend the function to include the y space and then the y/z space. I know it involves y0, y1, t, z0, z1, u. Any help with this would be appreciated. Thanks

##### Share on other sites
It's the same:

x = x0 + (s * (x1 - x0))y = y0 + (s * (y1 - y0))z = z0 + (s * (z1 - z0))

Or just let x0 and x1 be vectors.

##### Share on other sites
I realize that much...so say you have all the values for:

x = x0 + (s * (x1 - x0))

and

y = y0 + (t * (y1 - y0))

Isn't there a way to combine the two in some sort of formula to do quadratic interpolation?

##### Share on other sites
do you mean a spline by quadratic interpolation?
In this case you have 3 control points: p1,p2,p3
( each point contains x,y,z like p1.x of course )

The basic formula is f(x)= p1 * (1-x)^2+p2*(2*x*(1-x))+p3*x^2 , x = 0..1
Another way to write it is f(x) = lerp (lerp (p1,p2,x),p3,x) , x = 0..1