# Triangle function: tri

### 15.2.3 Triangle function: tri

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 15.2.2).
The tri command computes the triangle function.

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

#### Example.

Input:

tri(x-1)

Output:

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