Clip
Clip(expr)
returns
expr
in the range-1
to1
. Returns-1
ifexpr
is less than-1
. Returns1
ifexpr
is greater than1
.
Clip(expr, {min, max})
returns
expr
in the rangemin
tomax
. Returnsmin
ifexpr
is less thanmin
. Returnsmax
ifexpr
is greater thanmax
.
Clip(expr, {min, max}, {vMin, vMax})
returns
expr
in the rangemin
tomax
. ReturnsvMin
ifexpr
is less thanmin
. ReturnsvMax
ifexpr
is greater thanmax
.
See
Examples
>> Clip(Sin(Pi/7))Sin(Pi/7)
>> Clip(Tan(E))Tan(E)
>> Clip(Tan(2*E))-1
>> Clip(Tan(-2*E))1
>> Clip(x)Clip(x)
>> Clip(Tan(2*E), {-1/2,1/2})-1/2
>> Clip(Tan(-2*E), {-1/2,1/2})1/2
>> Clip(Tan(E), {-1/2,1/2}, {a,b})Tan(E)
>> Clip(Tan(2*E), {-1/2,1/2}, {a,b})a
>> Clip(Tan(-2*E), {-1/2,1/2}, {a,b})b
>> PiecewiseExpand(Clip(x))Piecewise({{-1,x<-1},{1,x>1}},x)
Related terms
Implementation status
- ✅ - full supported