MathUtils.Clamp
MathUtils.Clamp method
Clamp value to range [min, max]
public static double Clamp(double val, double min, double max)
Parameter | Type | Description |
---|---|---|
val | Double | Value to clamp. |
min | Double | Minimum value. |
max | Double | Maximum value. |
Return Value
The value between [min, max]
Examples
var val = 195;
//Clamp value to [0, 100]
var clampedValue = MathUtils.Clamp(val, 0, 100);
//This will output 100
Console.WriteLine($"Value = {val}");
See Also
- class MathUtils
- namespace Aspose.ThreeD.Utilities
- assembly Aspose.3D