Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity › Forums › Adobe After Effects Expressions › Why multiply on Pi

  • Why multiply on Pi

    Posted by Serge Druz on March 24, 2021 at 12:18 pm

    Hi, everybody, I noticed some pro artists do multiplication on Pi. Can you, please, explain what sense in that?
    For example in this expression, which gives you scale hesitation on each marker.

    look at “angle” variable, expression will work without “Math.PI” as well.

    n = 0;

    t = 0;

    if (marker.numKeys > 0){

    n = marker.nearestKey(time).index;

    if (marker.key(n).time > time) n–;

    }

    if (n > 0) t = time – marker.key(n).time;

    amp = 15;

    freq = 5;

    decay = 3.0;

    angle = freq * 2 * Math.PI * t;

    scaleFact = (100 + amp * Math.sin(angle) / Math.exp(decay * t)) / 100;

    [value[0] * scaleFact, value[1] / scaleFact];

    Serge Druz replied 5 years, 6 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    March 24, 2021 at 12:54 pm

    Multiplying by 2*pi allows you to express your frequency (freq) in cycles per second. So in your expression, the damped sine wave will oscillate at 5 cycles per second. Without the 2*pi, it will still oscillate, just a frequency that’s harder to predict. It’s just convenience (and convention) mainly.

  • Serge Druz

    March 25, 2021 at 1:12 pm

    God, bless internet, Dan, thank you so much for explaining things, really appreciate this.

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