Algosim documentation: tri

tri

The triangle function.

Syntax

Description

The triangle function is defined by

         ⎧ 0         if |x| > 1
tri(x) = ⎨
         ⎩ 1 − |x|   if |x| ≤ 1.

Notes

If you use the triangle function frequently, you may want to assign it to Λ or some other brief identifier:

Λ ≔ tri

See also