Class NumberUtils
java.lang.Object
de.metaphoriker.pathetic.api.util.NumberUtils
Utility class for common number operations.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic double
interpolate
(double a, double b, double progress) Interpolates between two values based on the given progress.static double
sqrt
(double input) Computes the square root of the given value using an approximation method.static double
square
(double value) Squares the given value.
-
Constructor Details
-
NumberUtils
public NumberUtils()
-
-
Method Details
-
interpolate
public static double interpolate(double a, double b, double progress) Interpolates between two values based on the given progress.- Parameters:
a
- the start valueb
- the end valueprogress
- the interpolation progress (0.0 to 1.0)- Returns:
- the interpolated value
-
square
public static double square(double value) Squares the given value.- Parameters:
value
- the value to be squared- Returns:
- the squared value
-
sqrt
public static double sqrt(double input) Computes the square root of the given value using an approximation method.- Parameters:
input
- the value to compute the square root of- Returns:
- the approximated square root
-