Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Exponentially grow then stop

  • Exponentially grow then stop

    Posted by John Winthrop on October 3, 2016 at 9:01 pm

    I made this expression to make a square rotate faster and faster and then stop accelerating when it got to a certain speed (b).
    ///////////
    t = Math.exp(time);
    b = time*50;

    Math.min(t, b);
    ////////////////////////

    problem is when it gets to the constant speed and the Math.min switches over to b, the rotation speed seems to not only stop accelerating but slow down quite a bit. What is wrong with this expression? I swear I did this before in a very simple way using Math.min and it worked.

    Dan Ebberts replied 9 years, 7 months ago 2 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    October 3, 2016 at 9:29 pm

    Your expression just switches from an exponential increase to a linear one where the two lines intersect. What do you want it to do?

    Dan

  • John Winthrop

    October 3, 2016 at 9:48 pm

    I want it to maintain the rotation speed it has when they intersect, so that when it switches from the exponential increase to the linear one, the increase is at the rate that the exponential was when the switched.

    Imagine a fan turning on, it has to keep accelerating then once it gets there it maintains that speed.

  • Dan Ebberts

    October 3, 2016 at 10:26 pm

    Is there any reason you want to use that linear line to define the time to switch to linear?

    If you just wanted to specify the time to switch, you could do it like this:


    tSwitch = 6.6;
    if (time < tSwitch)
    Math.exp(time)
    else
    Math.exp(tSwitch)*(1 + time - tSwitch)

    Or, if you want to specify the maximum speed, you could do this:


    maxSpeed = 735;
    tSwitch = Math.log(maxSpeed);
    if (time < tSwitch)
    Math.exp(time)
    else
    maxSpeed*(1 + time - tSwitch)

    Dan

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy