Class MathUtils

java.lang.Object
net.minestom.server.utils.MathUtils

@Internal public final class MathUtils extends Object
  • Method Details

    • square

      public static int square(int num)
    • square

      public static float square(float num)
    • square

      public static double square(double num)
    • round

      public static double round(double value, int places)
    • round

      public static float round(float value, int places)
    • getHorizontalDirection

      public static Direction getHorizontalDirection(float yawInDegrees)
    • isBetween

      public static boolean isBetween(byte number, byte min, byte max)
    • isBetween

      public static boolean isBetween(int number, int min, int max)
    • isBetween

      public static boolean isBetween(double number, double min, double max)
    • isBetween

      public static boolean isBetween(float number, float min, float max)
    • isBetweenUnordered

      public static boolean isBetweenUnordered(double number, double compare1, double compare2)
    • isBetweenUnordered

      public static boolean isBetweenUnordered(float number, float compare1, float compare2)
    • clamp

      public static int clamp(int value, int min, int max)
    • clamp

      public static float clamp(float value, float min, float max)
    • clamp

      public static double clamp(double value, double min, double max)
    • mod

      public static double mod(double a, double b)
    • bitsToRepresent

      public static int bitsToRepresent(int n)