Strata - v1.4.10
    Preparing search index...

    Function pingPong

    • Ping-pong - oscillates value between 0 and length

      Parameters

      • t: number

        Input value

      • length: number

        Length of oscillation

      Returns number

      Value oscillating between 0 and length

      pingPong(0, 1); // 0
      pingPong(0.5, 1); // 0.5
      pingPong(1.5, 1); // 0.5
      pingPong(2, 1); // 0