Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/wpf/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/docker/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wpf 放松功能的数学公式(弹性放松、循环放松、弹跳放松、回退放松、力量放松)?_Wpf_Math - Fatal编程技术网

Wpf 放松功能的数学公式(弹性放松、循环放松、弹跳放松、回退放松、力量放松)?

Wpf 放松功能的数学公式(弹性放松、循环放松、弹跳放松、回退放松、力量放松)?,wpf,math,Wpf,Math,我能算出所有多项式函数的公式, 例如,五分音符的公式为: (x-1)^5+1 但是什么是弹性、圆环、反弹、回退或力量的数学公式呢 它们都应该在0..1的范围内可以找到大多数公式,如果不正确,请检查相应的ease子网站 对于引用中没有命名函数的更复杂的函数,您可以使用反编译器,比如查看相应类上的EaseInCore方法的代码。查看此JavaScript项目,在底部您可以找到Tween.js文件,其中包含所需的公式 我发现了一个很好的站点,包含不同语言的实现: 例如,弹性缓和C++代码: float

我能算出所有多项式函数的公式, 例如,五分音符的公式为:

(x-1)^5+1

但是什么是弹性、圆环、反弹、回退或力量的数学公式呢


它们都应该在0..1的范围内

可以找到大多数公式,如果不正确,请检查相应的ease子网站


对于引用中没有命名函数的更复杂的函数,您可以使用反编译器,比如查看相应类上的
EaseInCore
方法的代码。

查看此JavaScript项目,在底部您可以找到Tween.js文件,其中包含所需的公式

我发现了一个很好的站点,包含不同语言的实现:

例如,弹性缓和C++代码:

float Elastic::easeIn (float t,float b , float c, float d) {
    if (t==0) return b;  if ((t/=d)==1) return b+c;  
    float p=d*.3f;
    float a=c; 
    float s=p/4;
    float postFix =a*pow(2,10*(t-=1)); // this is a fix, again, with post-increment operators
    return -(postFix * sin((t*d-s)*(2*PI)/p )) + b;
}

float Elastic::easeOut(float t,float b , float c, float d) {
    if (t==0) return b;  if ((t/=d)==1) return b+c;  
    float p=d*.3f;
    float a=c; 
    float s=p/4;
    return (a*pow(2,-10*t) * sin( (t*d-s)*(2*PI)/p ) + c + b);  
}

float Elastic::easeInOut(float t,float b , float c, float d) {
    if (t==0) return b;  if ((t/=d/2)==2) return b+c; 
    float p=d*(.3f*1.5f);
    float a=c; 
    float s=p/4;

    if (t < 1) {
        float postFix =a*pow(2,10*(t-=1)); // postIncrement is evil
        return -.5f*(postFix* sin( (t*d-s)*(2*PI)/p )) + b;
    } 
    float postFix =  a*pow(2,-10*(t-=1)); // postIncrement is evil
    return postFix * sin( (t*d-s)*(2*PI)/p )*.5f + c + b;
}
浮动弹性::easeIn(浮动t、浮动b、浮动c、浮动d){ if(t==0)返回b;if((t/=d)==1)返回b+c; 浮点数p=d*.3f; 浮点数a=c; 浮动s=p/4; float postFix=a*pow(2,10*(t-=1));//这也是一个使用后增量运算符的修复 返回-(后缀*sin((t*d-s)*(2*PI)/p))+b; } 浮动弹性::easeOut(浮动t、浮动b、浮动c、浮动d){ if(t==0)返回b;if((t/=d)==1)返回b+c; 浮点数p=d*.3f; 浮点数a=c; 浮动s=p/4; 返回(a*pow(2,-10*t)*sin((t*d-s)*(2*PI)/p)+c+b); } 浮动弹性::easeInOut(浮动t、浮动b、浮动c、浮动d){ if(t==0)返回b;if((t/=d/2)==2)返回b+c; 浮点数p=d*(.3f*1.5f); 浮点数a=c; 浮动s=p/4; if(t<1){ 浮点后缀=a*pow(2,10*(t-=1));//后增量是邪恶的 返回-.5f*(后缀*sin((t*d-s)*(2*PI)/p))+b; } 浮点后缀=a*pow(2,-10*(t-=1));//后增量是邪恶的 返回后缀*sin((t*d-s)*(2*PI)/p)*.5f+c+b; }
只有图像。在那里找不到0..1范围内的缓和函数的任何公式。不正确,在网站上,公式
f(t)=1-Sqrt(1-t^2)
被记录下来。哦,没有看到。谢谢!不幸的是,我对弹性和弹性的公式特别感兴趣。只是那些公式没有,谢谢!很棒的一页。它甚至还有一个图形预览器。为了在代码中使用缓和函数,它们被移动到t=0到t=1的范围。(x-1)^5执行x轴移动,+1执行y轴移动。EasingFunction使用的输入始终是标准化的,因此介于0和1之间。好的,很抱歉造成混淆。上述公式实际上是用于直接五次缓和计算。x^5用于缓进和计算缓出,范围被移动。我从WPF的EasingFunctionBase中获取的代码是:
1.0-this.EaseInCore(1.0-normalizedTime)
,当应用于五次易用时,它相当于上述公式。酷!非常感谢。如果我能接受第二个答案,那就是你的了。