Ease.easeOutElasticFunction C# (CSharp) Method

easeOutElasticFunction() private method

private easeOutElasticFunction ( float start, float end, float value ) : float
start float
end float
value float
return float
    private float easeOutElasticFunction(float start, float end, float value)
    {
        /* GFX47 MOD END */
        //Thank you to rafael.marteleto for fixing this as a port over from Pedro's UnityTween
        end -= start;

        float d = 1f;
        float p = d * .3f;
        float s = 0;
        float a = 0;

        if (value == 0) return start;

        if ((value /= d) == 1) return start + end;

        if (a == 0f || a < Mathf.Abs(end)){
            a = end;
            s = p / 4;
            }else{
            s = p / (2 * Mathf.PI) * Mathf.Asin(end / a);
        }

        return (a * Mathf.Pow(2, -10 * value) * Mathf.Sin((value * d - s) * (2 * Mathf.PI) / p) + end + start);
    }