public double Function(double t)
        {
            if (Math.Abs(P) < Precision.DOUBLE_EPSILON)
            {
                return(_linearDegenerate.GetInterpolation(t));
            }

            var p = -MathHelper.Clamp(P, -1, 1) * 10;

            return(t < 0.5 ? 0.5 * F(t * 2, p) : 0.5 + 0.5 * F(t * 2 - 1, -p));
        }
        public double Function(double t)
        {
            if (Math.Abs(P) < Precision.DOUBLE_EPSILON)
            {
                return(_linearDegenerate.GetInterpolation(t));
            }

            var p = MathHelper.Clamp(P, -1, 1) * 7;

            return(F(t, p));
        }
Example #3
0
        private double Function(double t)
        {
            if (Math.Abs(P) < Precision.DOUBLE_EPSILON)
            {
                return(_linearDegenerate.GetInterpolation(t));
            }

            var p = MathHelper.Clamp(P, -1, 1);
            var b = 2 * Math.Acos(1 / (Math.Sqrt(2) * Math.Abs(p) - Math.Abs(p) + 1));

            return(p < 0 ?
                   1 - F(1 - t, b) :
                   F(t, b));
        }