Package com.tonic.vellum
Class Maths
- java.lang.Object
-
- com.tonic.vellum.Maths
-
public final class Maths extends java.lang.ObjectSmall numeric helpers.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static doubleclamp(double value, double min, double max)Constrainsvalueto the inclusive range[min, max].static intclamp(int value, int min, int max)Constrainsvalueto the inclusive range[min, max].
-
-
-
Method Detail
-
clamp
public static int clamp(int value, int min, int max)Constrainsvalueto the inclusive range[min, max].- Parameters:
value- the value to constrainmin- the lower bound, inclusivemax- the upper bound, inclusive- Returns:
- the clamped value
-
clamp
public static double clamp(double value, double min, double max)Constrainsvalueto the inclusive range[min, max].- Parameters:
value- the value to constrainmin- the lower bound, inclusivemax- the upper bound, inclusive- Returns:
- the clamped value
-
-