The most common definition is as a piecewise function: \begin{align} \operatorname{tri}(x) = \Lambda(x) \ &\overset{\underset{\text{def}}{}}{=} \ \max\big(1 - |x|, 0\big) \\ &= \begin{cases} 1 - |x|, & |x| Equivalently, it may be defined as the
convolution of two identical unit
rectangular functions: \begin{align} \operatorname{tri}(x) &= \operatorname{rect}(x) * \operatorname{rect}(x) \\ &= \int_{-\infty}^\infty \operatorname{rect}(x - \tau) \cdot \operatorname{rect}(\tau) \,d\tau. \\ \end{align} The triangular function can also be represented as the product of the rectangular and
absolute value functions: \operatorname{tri}(x) = \operatorname{rect}(x/2) \big(1 - |x|\big). Note that some authors instead define the triangle function to have a base of width 1 instead of width 2: \begin{align} \operatorname{tri}(2x) = \Lambda(2x) \ & \overset{\underset{\text{def}}{}}{=} \ \max\big(1 - 2|x|, 0\big) \\ &= \begin{cases} 1 - 2|x|, & |x| In its most general form a triangular function is any linear
B-spline: \operatorname{tri}_j(x) = \begin{cases} (x - x_{j-1})/(x_j - x_{j-1}), & x_{j-1} \le x Whereas the definition at the top is a special case \Lambda(x) = \operatorname{tri}_j(x), where x_{j-1} = -1, x_j = 0, and x_{j+1} = 1. A linear B-spline is the same as a continuous
piecewise linear function f(x), and this general triangle function is useful to formally define f(x) as f(x) = \sum_j y_j \cdot \operatorname{tri}_j(x), where x_j for all integer j. The piecewise linear function passes through every point expressed as coordinates with
ordered pair (x_j, y_j), that is, f(x_j) = y_j. ==Scaling==