RhinoCommon API
RhinoMathClamp Method (Double, Double, Double) |
Restricts a Double to be specified within an interval of two numbers.
Namespace: Rhino
Assembly: RhinoCommon (in RhinoCommon.dll)

public static double Clamp( double value, double bound1, double bound2 )
Public Shared Function Clamp ( value As Double, bound1 As Double, bound2 As Double ) As Double
Parameters
- value
- Type: SystemDouble
A number. - bound1
- Type: SystemDouble
A first bound. - bound2
- Type: SystemDouble
A second bound. This does not necessarily need to be larger or smaller than bound1.
Return Value
Type: DoubleThe clamped value.

Rhino for Mac
Supported in: 5.4Rhino for Windows
Supported in: 6.8