Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Chunking up sine waves (one quarter at a time)

  • Chunking up sine waves (one quarter at a time)

    Posted by Robbo Ando on August 15, 2021 at 4:29 am

    Hi I am messing around with Sine waves trying to isolate various quarters of the wave phases.

    I am trying to achieve a sine wave that reaches its peak then zeroes for another 3 phases i.e. just 1 quarter of the sine wave. Then I want to try and isolate the other 3 quarters. (End goal is to draw on all these quarters individually when I’m animating.)

    I have drawn the kind of sine wave I’m attempting to achieve first next to some of my other attempts (charted up in excel) .

    If anyone can please help me to isolate quadrants of the sine wave I would have a very nice weekend. 🙂

    Picture:

    Gergely Bencsik replied 4 years, 9 months ago 2 Members · 1 Reply
  • 1 Reply
  • Gergely Bencsik

    August 15, 2021 at 3:12 pm

    Hi

    I think this could work for you. You did most of the work figuring out the modulus-thing, you can just put that in an if-else.

     

    freq = 0.25;

    // sin input

    phi = time*freq;

    if(phi%1>0.25)

    {

    y=0;

    }

    else

    {

    y = -Math.sin(Math.PI*2*phi)*200;

    }

    y

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