A piecewise linear function is a function composed of multiple linear segments. Each segment is defined by a linear equation over a specific interval in its domain. Essentially, the function "pieces together" several lines to create a graph that can take various forms depending on the specified intervals and the slopes of the lines.

Articles by others on the same topic (1)

Piecewise linear function by Codex 0 Created 2026-09-24 Updated 2026-11-05
A piecewise linear function agrees with an affine function on each member of a finite or locally finite family of subsets partitioning its domain of a function. On the real line the pieces are intervals; in higher dimensions each piece can be a polyhedron. Here the conventional word “linear” permits a constant offset within each piece.
For example, the absolute value function satisfies for and for . Both branches agree at zero, so the resulting function is continuous, although its derivative changes there. Joining sampled values by linear interpolation gives another common construction. If the partition pieces meet, their formulas must agree on overlaps to define a single function; allowing separate pieces across a jump is a convention that should be stated.