net.minecraft.util

## Class MathHelper

- java.lang.Object
- - net.minecraft.util.MathHelper

-     public class MathHelper
      extends Object

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MathHelper()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static int` | `abs_int(int par0)` Returns the unsigned value of an int.
    `static double` | `abs_max(double par0, double par2)` Maximum of the absolute value of two numbers.
    `static float` | `abs(float par0)`
    `static double` | `average(long[] par0ArrayOfLong)`
    `static int` | `bucketInt(int par0, int par1)`
    `static int` | `ceiling_double_int(double par0)`
    `static int` | `ceiling_float_int(float par0)`
    `static float` | `clamp_float(float par0, float par1, float par2)`
    `static int` | `clamp_int(int par0, int par1, int par2)` Returns the value of the first parameter, clamped to be within the lower and upper limits given by the second and third parameters.
    `static float` | `cos(float par0)` cos looked up in the sin table with the appropriate offset
    `static long` | `floor_double_long(double par0)` Long version of floor_double
    `static int` | `floor_double(double par0)` Returns the greatest integer less than or equal to the double argument
    `static int` | `floor_float(float par0)` Returns the greatest integer less than or equal to the float argument
    `static double` | `func_82713_a(String par0Str, double par1, double par3)`
    `static double` | `getRandomDoubleInRange(Random par0Random, double par1, double par3)`
    `static int` | `getRandomIntegerInRange(Random par0Random, int par1, int par2)`
    `static double` | `parseDoubleWithDefault(String par0Str, double par1)` parses the string as double or returns the second parameter if it fails.
    `static int` | `parseIntWithDefault(String par0Str, int par1)` parses the string as integer or returns the second parameter if it fails
    `static int` | `parseIntWithDefaultAndMax(String par0Str, int par1, int par2)` parses the string as integer or returns the second parameter if it fails.
    `static float` | `sin(float par0)` sin looked up in a table
    `static float` | `sqrt_double(double par0)`
    `static float` | `sqrt_float(float par0)`
    `static boolean` | `stringNullOrLengthZero(String par0Str)`
    `static int` | `truncateDoubleToInt(double par0)`
    `static double` | `wrapAngleTo180_double(double par0)` the angle is reduced to an angle between -180 and +180 by mod, and a 360 check
    `static float` | `wrapAngleTo180_float(float par0)` the angle is reduced to an angle between -180 and +180 by mod, and a 360 check

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### MathHelper

          public MathHelper()

  - ### Method Detail

    - #### sin

          public static final float sin(float par0)

      sin looked up in a table

    - #### cos

          public static final float cos(float par0)

      cos looked up in the sin table with the appropriate offset

    - #### sqrt_float

          public static final float sqrt_float(float par0)

    - #### sqrt_double

          public static final float sqrt_double(double par0)

    - #### floor_float

          public static int floor_float(float par0)

      Returns the greatest integer less than or equal to the float argument

    - #### truncateDoubleToInt

          public static int truncateDoubleToInt(double par0)

    - #### floor_double

          public static int floor_double(double par0)

      Returns the greatest integer less than or equal to the double argument

    - #### floor_double_long

          public static long floor_double_long(double par0)

      Long version of floor_double

    - #### abs

          public static float abs(float par0)

    - #### abs_int

          public static int abs_int(int par0)

      Returns the unsigned value of an int.

    - #### ceiling_float_int

          public static int ceiling_float_int(float par0)

    - #### ceiling_double_int

          public static int ceiling_double_int(double par0)

    - #### clamp_int

          public static int clamp_int(int par0,
                      int par1,
                      int par2)

      Returns the value of the first parameter, clamped to be within the lower and upper limits given by the second and third parameters.

    - #### clamp_float

          public static float clamp_float(float par0,
                          float par1,
                          float par2)

    - #### abs_max

          public static double abs_max(double par0,
                       double par2)

      Maximum of the absolute value of two numbers.

    - #### bucketInt

          public static int bucketInt(int par0,
                      int par1)

    - #### stringNullOrLengthZero

          public static boolean stringNullOrLengthZero(String par0Str)

    - #### getRandomIntegerInRange

          public static int getRandomIntegerInRange(Random par0Random,
                                    int par1,
                                    int par2)

    - #### getRandomDoubleInRange

          public static double getRandomDoubleInRange(Random par0Random,
                                      double par1,
                                      double par3)

    - #### average

          public static double average(long[] par0ArrayOfLong)

    - #### wrapAngleTo180_float

          public static float wrapAngleTo180_float(float par0)

      the angle is reduced to an angle between -180 and +180 by mod, and a 360 check

    - #### wrapAngleTo180_double

          public static double wrapAngleTo180_double(double par0)

      the angle is reduced to an angle between -180 and +180 by mod, and a 360 check

    - #### parseIntWithDefault

          public static int parseIntWithDefault(String par0Str,
                                int par1)

      parses the string as integer or returns the second parameter if it fails

    - #### parseIntWithDefaultAndMax

          public static int parseIntWithDefaultAndMax(String par0Str,
                                      int par1,
                                      int par2)

      parses the string as integer or returns the second parameter if it fails. this value is capped to par2

    - #### parseDoubleWithDefault

          public static double parseDoubleWithDefault(String par0Str,
                                      double par1)

      parses the string as double or returns the second parameter if it fails.

    - #### func_82713_a

          public static double func_82713_a(String par0Str,
                            double par1,
                            double par3)