Class MathUtilities
Provides static methods not included in the standard Math class.
Inheritance
Inherited Members
Namespace: Telerik.Windows.Controls
Assembly: Telerik.Windows.Controls.dll
Syntax
public static class MathUtilities
Methods
Clamp(Double, Double, Double)
Restricts a value to be within a specified range.
Declaration
public static double Clamp(double value, double min, double max)
Parameters
System.Double
value
The value to clamp. |
System.Double
min
The minimum value. |
System.Double
max
The maximum value. |
Returns
System.Double
The clamped value. |
Clamp(Double, Double, Double, Int32)
Restricts a value to be within a specified range.
Declaration
public static double Clamp(double value, double minimum, double maximum, int precision)
Parameters
System.Double
value
The value to clamp. |
System.Double
minimum
The minimum value. |
System.Double
maximum
The maximum value. |
System.Int32
precision
The rounding precision value. |
Returns
System.Double
The clamped value. |
Clamp(Int32, Int32, Int32)
Restricts a value to be within a specified range.
Declaration
public static int Clamp(int value, int min, int max)
Parameters
System.Int32
value
The value to clamp. |
System.Int32
min
The minimum value. |
System.Int32
max
The maximum value. |
Returns
System.Int32
The clamped value. |
IsInRange(Int32, Int32, Int32)
Checks if a value is within a specified range.
Declaration
public static bool IsInRange(int value, int min, int max)
Parameters
System.Int32
value
The value to check. |
System.Int32
min
The minimum value. |
System.Int32
max
The maximum value. |
Returns
System.Boolean
True if the values is within the range, false otherwise. |