Class NumberUtils

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

public final class NumberUtils extends Object
Utility class for common number operations.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static 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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 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

      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