ProtoFlux:Clamp 01: Difference between revisions

From Resonite Wiki
Add plot
m Change plot bounds to be more symmetric
Line 14: Line 14:
{{#invoke:Plotter|Plot2D
{{#invoke:Plotter|Plot2D
|From=-1.1, 0
|From=-1.1, 0
|To=2.1, 1.2
|To=2.1, 1.1
|Plots=
|Plots=
[
[

Revision as of 02:03, 13 February 2024

Clamp01
N
*
Math
0 1 2 -1 1
clamp 01

Clamp 01 clamps the provided numeric value between 0 and 1.

Inputs

N (Generic)

A numeric value.

Outputs

* (Generic)

The input value, with the following conditions:

  1. If N < 0, output 0
  2. If N > 1, output 1
  3. Otherwise, output N

In the case of types with multiple values, each individual value will be clamped.

Examples