### 21.1.3 Triangle function

The triangle function is defined by

Λ(x)= |
⎧ ⎨ ⎩ |
1−|x|, | |x|<1,
0, | otherwise.

This is equal to the convolution of rectangle function with itself (see Section 21.1.2).

The tri command computes the triangle function.

- tri takes x, an expression.
- tri(x) returns the value of triangle function at x.

#### Example

tri(x-1)

| ⎛ ⎝ | −x+1+1 | ⎞ ⎠ | ⎛ ⎝ | θ | ⎛ ⎝ | x−1 | ⎞ ⎠ | −θ | ⎛ ⎝ | x−1−1 | ⎞ ⎠ | ⎞ ⎠ | + | ⎛ ⎝ | 1+x−1 | ⎞ ⎠ | ⎛ ⎝ | θ | ⎛ ⎝ | −x+1 | ⎞ ⎠ | −θ | ⎛ ⎝ | −x+1−1 | ⎞ ⎠ | ⎞ ⎠