A function whose graph is a triangle wave.
xis a real number
TriangleWave(x) is a triangle wave with amplitude
1 and wavelength
2⋅π. The range is
[−1, 1] and the graph is a straight line through the origin from
x = −π/2 to
x = π/2.