m ProbablePrime moved page Clamp 01 (ProtoFlux) to ProtoFlux:Clamp 01: Creating protoflux Namespace |
Add plot |
||
Line 11: | Line 11: | ||
] | ] | ||
|}} | |}} | ||
{{#invoke:Plotter|Plot2D | |||
|From=-1.1, 0 | |||
|To=2.1, 1.2 | |||
|Plots= | |||
[ | |||
{"Type": "function", "Function": "x", "Samples": 2, "Label": "clamp 01", "Ranges":[{"From": "0", "To": "1"}]}, | |||
{"Type": "function", "Function": "0", "Samples": 2, "Color": 1, "Ranges":[{"To": "0"}]}, | |||
{"Type": "function", "Function": "1", "Samples": 2, "Color": 1, "Ranges":[{"From": "1"}]} | |||
] | |||
}} | |||
'''Clamp 01''' clamps the provided numeric value between 0 and 1. | '''Clamp 01''' clamps the provided numeric value between 0 and 1. |
Revision as of 23:37, 12 February 2024
Clamp01
Math
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:
- If
N < 0
, output0
- If
N > 1
, output1
- Otherwise, output
N
In the case of types with multiple values, each individual value will be clamped.
Examples
-
Four examples of the Clamp 01 node.