Triangle Wave — Definition, Formula & Examples
A triangle wave is a periodic function that rises and falls in straight-line segments, creating a zigzag shape that resembles a series of triangles. Unlike a sine wave's smooth curves, every piece of a triangle wave is a straight line with constant slope.
A triangle wave with period and amplitude is a continuous, piecewise-linear function that increases linearly from to over the first half-period and decreases linearly from to over the second half-period, repeating this pattern for all real numbers.
Key Formula
Where:
- = Value of the triangle wave at input x
- = Amplitude (peak value of the wave)
- = Period (horizontal length of one full cycle)
- = Modulo operation, giving the remainder after division
How It Works
You can build a triangle wave using the absolute value function. Start with a sawtooth pattern by taking the fractional or modular part of the input, then apply an absolute value and rescale. The key idea is that each period consists of exactly two linear pieces — one with positive slope and one with negative slope — joined at sharp corners. These corners are the absolute maximum and absolute minimum of the function within each period.
Worked Example
Problem: A triangle wave has amplitude 3 and period 4. Find the value of the wave at x = 1, x = 2, and x = 3.
Describe the wave: With period 4 and amplitude 3, the wave rises from −3 to 3 over the first half-period (0 to 2), then falls from 3 to −3 over the second half-period (2 to 4).
Find T(1): At x = 1 (one-quarter of the period), the wave is halfway through its rise from −3 to 3.
Find T(2): At x = 2 (half the period), the wave reaches its peak.
Find T(3): At x = 3, the wave is halfway through its descent from 3 to −3.
Answer: T(1) = 0, T(2) = 3, T(3) = 0.
Visualization
Why It Matters
Triangle waves appear in signal processing, sound synthesis, and electronics as one of the basic waveform types alongside sine, square, and sawtooth waves. In Fourier analysis, a triangle wave is expressed as an infinite sum of odd-harmonic sine functions, making it a concrete example of how piecewise-linear functions connect to trigonometric series.
Common Mistakes
Mistake: Confusing a triangle wave with a sawtooth wave because both are piecewise linear.
Correction: A sawtooth wave rises (or falls) linearly across the entire period and then jumps discontinuously. A triangle wave rises for half the period and falls for the other half, remaining continuous everywhere.
