A function whose graph is a square wave.
xis a real number
SquareWave(x) is a square wave with amplitude
1 and wavelength
2⋅π. The range is
[−1, 1] and the function transitions from
x = 0. The value at each transition is
SquareWave(x) = sgn(sin(x))
(except for numerical issues).