Example #1
0
        public static Func <T, TEx <R> > EaseD <T, R>(Func <tfloat, tfloat> easer, float maxTime,
                                                      Func <T, TEx <R> > fd, Func <T, Ex> t, Func <T, Ex, T> withT)
        {
            var ratTime = ExUtils.VFloat();

            // x'(t) = f'(g(t)) g'(t). Where g(t) = T e(t/T): g'(t) = e'(t/T)
            return(bpi => Ex.Block(new[] { ratTime },
                                   Ex.Assign(ratTime, Clamp01(ExC(1f / maxTime).Mul(t(bpi)))),
                                   Ex.Multiply(
                                       DerivativeVisitor.Derivate(ratTime, E1, easer(ratTime)),
                                       fd(withT(bpi, ExC(maxTime).Mul(easer(ratTime)))))
                                   ));
        }
Example #2
0
 public static Ex Derivate(this Ex ex, Ex x, Ex dx) => DerivativeVisitor.Derivate(x, dx, ex);