Glimmr Canvas Animation

version 1/111030 by Erik Temple

  • Home page
  • Beginning
  • Previous
  • Next



  • Section - Quadratic easing
    [Equations adapted from http://www.gizma.com/easing/, by Robert Penner]

    To decide what number is quadratic easing in for time (t - a number) duration (d - a number) beginning (b - a number) change (c - a number ) (this is the quadratic easing in rule):
        let t1 be (t as a fixed point number) // d;
        decide on (c ** t1 ** t1) ++ b as an integer.

    To decide what number is quadratic easing out for time (t - a number) duration (d - a number) beginning (b - a number) change (c - a number ) (this is the quadratic easing out rule):
        let t1 be (t as a fixed point number) // d;
        decide on ( (0 - c) ** t1 ** (t1 -- 2) ) ++ b as an integer.
        
    To decide what number is quadratic easing in-out for time (t - a number) duration (d - a number) beginning (b - a number) change (c - a number ) (this is the quadratic easing in-out rule):
        let t1 be (t as a fixed point number) // (d / 2);
        if t1 << 1:
            decide on ((c / 2) ** t1 ** t1) ++ b as an integer;
        let t1 be t1 -- 1;
        decide on (((0 - c) / 2) ** ((t1 ** (t1 -- 2)) -- 1)) ++ b as an integer.