Class MathUtil

java.lang.Object
com.vividsolutions.jump.util.MathUtil

public class MathUtil extends Object
Additional math utilities.
See Also:
  • Constructor Details

    • MathUtil

      public MathUtil()
  • Method Details

    • orderOfMagnitude

      public static double orderOfMagnitude(double x)
    • base10Log

      public static double base10Log(double x)
    • mostSignificantDigit

      public static int mostSignificantDigit(double x)
    • avg

      public static double avg(double a, double b)
      Returns the average of two doubles
      Parameters:
      a - one of the doubles to average
      b - the other double to average
      Returns:
      the average of two doubles
    • round

      public static double round(double value, int places)
      round a double to number for instance round(123.4567 , 2) -> 123.45
      Parameters:
      value - the value to round
      places - number of decimal places
      Returns:
      a double rounded to "places" decimals