The triangle function , also tri function, triangle function or tent function, is a mathematical function with the following definition:

${\ displaystyle {\ begin {aligned} \ operatorname {tri} (t) = \ land (t) \ quad & {\ overset {\ underset {\ mathrm {def}} {}} {=}} \ \ max ( 1- | t |, 0) \\ & = {\ begin {cases} 1- | t |, & | t | <1 \\ 0, & {\ mbox {otherwise}} \ end {cases}} \ end {aligned}}}$.

Equivalent to this, it can also be defined as a convolution of the rectangular function with itself, as is clearly shown in the figure below:
${\ displaystyle \ operatorname {rect}}$

${\ displaystyle {\ begin {aligned} \ operatorname {tri} (t) = \ operatorname {rect} (t) * \ operatorname {rect} (t) \ quad & {\ overset {\ mathrm {def}} {= }} \ int _ {- \ infty} ^ {\ infty} \ mathrm {rect} (\ tau) \ cdot \ mathrm {rect} (t- \ tau) \ d \ tau \\ & = \ int _ {- \ infty} ^ {\ infty} \ mathrm {rect} (\ tau) \ cdot \ mathrm {rect} (\ tau -t) \ d \ tau \ end {aligned}}}$.

Convolution of two rectangular functions results in the triangular function

The triangle function can be scaled using a parameter :
${\ displaystyle a \ neq 0}$

${\ displaystyle {\ begin {aligned} \ operatorname {tri} (t / a) & = {\ begin {cases} 1- | t / a |, & | t | <| a | \\ 0, & {\ mbox {otherwise}}. \ end {cases}} \ end {aligned}}}$

In general, one would like to scale the triangle function. The stretching in the x-direction and the height at the top are of interest here. Half the period, i.e. the distance from the start of the triangular function to the center point, is used for the stretching . The height at the point is through
${\ displaystyle T}$${\ displaystyle t_ {0}}$${\ displaystyle t_ {0}}$

${\ displaystyle a \ cdot \ operatorname {tri} \ left ({\ frac {t-t_ {0}} {T}} \ right)}$

given.

Derivation

The derivative of the triangle function is a sum of two rectangular functions:
${\ displaystyle \ operatorname {rect}}$

where the period, the center and the height of the triangular function represent. The prefactor therefore appears as the slope of the triangle function in the derivative.
${\ displaystyle 2T}$${\ displaystyle t_ {0}}$${\ displaystyle a}$${\ displaystyle {\ tfrac {a} {T}}}$

Triangular oscillation

In contrast to the triangle function shown here, a triangular oscillation is a periodic function that results from the periodic continuation of the interval , generally supplemented by a constant offset. A triangular oscillation in the narrower sense does not contain a constant component , so the minima and maxima are equal in terms of amount.
${\ displaystyle [-1.1]}$

The function

${\ displaystyle \ Delta (t) = 2a \ cdot \ left | \ max (1 - ((2f \ cdot t) {\ bmod {2}}), - 1) \ right | -a}$