The rectangular function (also known as the rectangle function, rect function, Pi function, Heaviside Pi function, gate function, unit pulse, or the normalized boxcar function) is defined as
rect ( t a ) = Π ( t a ) = { 0 , if | t | > a 2 1 2 , if | t | = a 2 1 , if | t | < a 2 . {\displaystyle \operatorname {rect} \left({\frac {t}{a}}\right)=\Pi \left({\frac {t}{a}}\right)=\left\{{\begin{array}{rl}0,&{\text{if }}|t|>{\frac {a}{2}}\\{\frac {1}{2}},&{\text{if }}|t|={\frac {a}{2}}\\1,&{\text{if }}|t|<{\frac {a}{2}}.\end{array}}\right.}
Alternative definitions of the function define rect ( ± 1 2 ) {\textstyle \operatorname {rect} \left(\pm {\frac {1}{2}}\right)} to be 0, 1, or undefined.
Its periodic version is called a rectangular wave.