Package arcommon

Class MathUtil


  • public class MathUtil
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      MathUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static double degreesToRadians​(double angle)  
      static int log10​(long number)  
      static int log2​(long number)  
      static int logN​(long number, long log)  
      static double radiansToDegrees​(double radians)  
      static void randomize()  
      static int randomNumber​(int maximumValueNotIncluded)  
      static java.lang.String randomString​(int length, java.lang.String symbols)  
      static void setSeed​(long seed)  
      static int signum​(long number)
      Returns the signum function of the argument.
      static double xyDiffToLength​(int x1, int y1, int x2, int y2)  
      static double xyToAngle​(int diffX, int diffY)  
      static double xyToLength​(int x, int y)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • setSeed

        public static void setSeed​(long seed)
      • randomNumber

        public static int randomNumber​(int maximumValueNotIncluded)
      • randomString

        public static java.lang.String randomString​(int length,
                                                    java.lang.String symbols)
      • log10

        public static int log10​(long number)
      • log2

        public static int log2​(long number)
      • logN

        public static int logN​(long number,
                               long log)
      • signum

        public static int signum​(long number)
        Returns the signum function of the argument.
        Return zero if the argument is zero, 1 if the argument is greater than zero, -1 if the argument is less than zero.
        See Also:
        see java.lang.Math.signum(doable) for a double variant, see java.lang.Math.signum(float) for a float variant
      • xyToAngle

        public static double xyToAngle​(int diffX,
                                       int diffY)
      • xyToLength

        public static double xyToLength​(int x,
                                        int y)
      • xyDiffToLength

        public static double xyDiffToLength​(int x1,
                                            int y1,
                                            int x2,
                                            int y2)