Sign in to follow this  

lerp between functions

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

Is it possible to lerp between functions ?

The general formula that can be used for lerp between vectors is (1-t)v + tv1. But what if instead of a vector we put in a function like (1-t)x + v*x^2 where f(x) = x is the first function and g(x) = x^2 is second one. Will this work ?

Share this post


Link to post
Share on other sites

Yes that would just be pointwise lerp between the functions evaluated at a specific point. A function can often be considered to be a vector anyway (e.g. the vector space C[0,1] is the space of all continuous functions defined in the interval [0,1]).

Share this post


Link to post
Share on other sites
If we want to be completely pedantic, LERP is an operation that is defined in affine spaces. So for instance you can linearly interpolate between two positions, even though positions are not vectors. But every vector space can be seen as an affine space as well (some people think of this as "forgetting where the origin is"), so you can use LERP in any vector space, including spaces of functions.

Share this post


Link to post
Share on other sites

I am not sure if this is right but if we take some other functions that are not linear like quadratic, will this still than hold ?

Will the space than again be affine ?

Share this post


Link to post
Share on other sites

I am a little confused. But anyway I can take any function I want for f(x) and g(x) so that (1-t)f(x) + tg(x) ?

What would be the cases where I could not take any function ?

Share this post


Link to post
Share on other sites


But anyway I can take any function I want for f(x) and g(x) so that (1-t)f(x) + tg(x) ?

Yes.

 


What would be the cases where I could not take any function ?

I don't understand that question. If you are asking about situations where it is not OK to take linear combinations like that, think of two points on the surface of a doughnut, two 3D rotations or even two points on a circle. There might be ways to make something that behaves similarly to LERP in those cases, but it will be much less straight forward than (1-t)*A+t*B.

Share this post


Link to post
Share on other sites

 I don't understand that question. If you are asking about situations where it is not OK to take linear combinations like that, think of two points on the surface of a doughnut, two 3D rotations or even two points on a circle. There might be ways to make something that behaves similarly to LERP in those cases, but it will be much less straight forward than (1-t)*A+t*B.

 

 I was asking that to see if there were cases where I could not do this.

 

Thank you, it is much clearer to me now.

Share this post


Link to post
Share on other sites

You'll maybe just have to be careful about possible discontinuities in f(x) or g(x). If one of them gives you infinity for a particular x, LERPing the values won't be straightforward.

Share this post


Link to post
Share on other sites

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

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this