Previous Up Next

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.


Example.
Input:

tri(x-1)

Output:

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

Previous Up Next