Class NumberUtils

java.lang.Object
de.bsommerfeld.pathetic.api.util.NumberUtils

public final class NumberUtils extends Object
Utility class for common number operations.
  • 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 value
      b - the end value
      progress - 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

      @Deprecated public static double sqrt(double input)
      Deprecated.
      Call Math.sqrt(double) directly. This now simply delegates to it; the former bit-hack approximation was less precise than the JDK intrinsic (and wrong at 0) without being faster.
      Computes the square root of the given value.
      Parameters:
      input - the value to compute the square root of
      Returns:
      the square root of input