# Interpolation

This topic is 3988 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

1. 1
2. 2
Rutin
15
3. 3
4. 4
5. 5

• 13
• 26
• 10
• 11
• 9
• ### Forum Statistics

• Total Topics
633732
• Total Posts
3013584
×