Class MathUtil

java.lang.Object
net.rodofire.easierworldcreator.maths.MathUtil

public class MathUtil extends Object
util math class
  • Constructor Details

    • MathUtil

      public MathUtil()
  • Method Details

    • getRandomOpposite

      public static int getRandomOpposite()
      method to get a random opposite with a 50% chance
      Returns:
      a random opposite
    • getRandomOpposite

      public static int getRandomOpposite(float chance)
      method to get a random opposite with the wanted chance
      Parameters:
      chance - the chance of -1 being selected
      Returns:
      a random opposite
    • getRandomBoolean

      public static boolean getRandomBoolean(float chance)
      method to get a random boolean
      Parameters:
      chance - the chance of true being selected
      Returns:
      the random boolean
    • getSign

      public static int getSign(int a)
      method to get the sign of a number
      Parameters:
      a - the int to compare
      Returns:
      the sign of the int
    • getSign

      public static int getSign(double a)
      method to get the sign of a number
      Parameters:
      a - the double to compare
      Returns:
      the sign of the double
    • getSign

      public static int getSign(float a)
      method to get the sign of a number
      Parameters:
      a - the float to compare
      Returns:
      the sign of the float