A simple equation with a period of 4, with y ( 0 ) = 1 {\displaystyle y(0)=1} . As this only uses the modulo operation and absolute value, this can be used to simply implement a triangle wave on hardware electronics with less CPU power: