Class MathMan

java.lang.Object
com.plotsquared.core.util.MathMan

public class MathMan extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static final float
    atan2(float y, float x)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Unused internally.
    static final int
    average(int a, int b)
     
    static int
    floorMod(int x, int y)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Unused internally.
    static final int
    gcd(int[] a)
     
    static final int
    gcd(int a, int b)
     
    static float[]
    getDirection(float yaw, float pitch)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Unused internally.
    static double
    getMean(double[] array)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Unused internally.
    static double
    getMean(int[] array)
     
    static float[]
    getPitchAndYaw(float x, float y, float z)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Unused internally.
    static int
     
    static double
    getSD(double[] array, double av)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Unused internally.
    static double
    getSD(int[] array, double av)
     
    static long
    inverseRound(double val)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Unused internally.
    static float
    invSqrt(float x)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Unused internally.
    static boolean
     
    static boolean
    isPowerOfTwo(int number)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Unused internally.
    static int
    mod(int x, int y)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Unused internally.
    static int
    pair(short x, short y)
     
    static byte
    pair16(byte x, byte y)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Unused internally.
    static long
    pairInt(int x, int y)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Unused internally.
    static int
    roundInt(double value)
     
    static int
    sqrt(int x)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Unused internally.
    static double
    sqrtApprox(double d)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Unused internally.
    static float
    sqrtApprox(float f)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Unused internally.
    static byte
    unpair16x(byte value)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Unused internally.
    static byte
    unpair16y(byte value)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Unused internally.
    static int
    unpairIntX(long pair)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Unused internally.
    static int
    unpairIntY(long pair)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Unused internally.
    static short
    unpairX(int hash)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Unused internally.
    static short
    unpairY(int hash)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Unused internally.
    static int
    unsignedmod(int x, int y)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Unused internally.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • gcd

      public static final int gcd(int a, int b)
    • gcd

      public static final int gcd(int[] a)
    • pairInt

      @Deprecated(forRemoval=true, since="6.11.1") public static long pairInt(int x, int y)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Unused internally. Scheduled for removal in next major release.
    • unpairIntX

      @Deprecated(forRemoval=true, since="6.11.1") public static int unpairIntX(long pair)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Unused internally. Scheduled for removal in next major release.
    • unpairIntY

      @Deprecated(forRemoval=true, since="6.11.1") public static int unpairIntY(long pair)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Unused internally. Scheduled for removal in next major release.
    • pair16

      @Deprecated(forRemoval=true, since="6.11.1") public static byte pair16(byte x, byte y)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Unused internally. Scheduled for removal in next major release.
    • unpair16x

      @Deprecated(forRemoval=true, since="6.11.1") public static byte unpair16x(byte value)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Unused internally. Scheduled for removal in next major release.
    • unpair16y

      @Deprecated(forRemoval=true, since="6.11.1") public static byte unpair16y(byte value)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Unused internally. Scheduled for removal in next major release.
    • inverseRound

      @Deprecated(forRemoval=true, since="6.11.1") public static long inverseRound(double val)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Unused internally. Scheduled for removal in next major release.
    • sqrt

      @Deprecated(forRemoval=true, since="6.11.1") public static int sqrt(int x)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Unused internally. Scheduled for removal in next major release.
    • getMean

      public static double getMean(int[] array)
    • getMean

      @Deprecated(forRemoval=true, since="6.11.1") public static double getMean(double[] array)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Unused internally. Scheduled for removal in next major release.
    • pair

      public static int pair(short x, short y)
    • average

      public static final int average(int a, int b)
    • unpairX

      @Deprecated(forRemoval=true, since="6.11.1") public static short unpairX(int hash)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Unused internally. Scheduled for removal in next major release.
    • unpairY

      @Deprecated(forRemoval=true, since="6.11.1") public static short unpairY(int hash)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Unused internally. Scheduled for removal in next major release.
    • getDirection

      @Deprecated(forRemoval=true, since="6.11.1") public static float[] getDirection(float yaw, float pitch)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Unused internally. Scheduled for removal in next major release.
      get the x,y,z unit vector from pitch and yaw specified
      Parameters:
      yaw - yaw
      pitch - pitch
      Returns:
      x, y, z unit vector
    • floorMod

      @Deprecated(forRemoval=true, since="6.11.1") public static int floorMod(int x, int y)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Unused internally. Scheduled for removal in next major release.
    • roundInt

      public static int roundInt(double value)
    • getPitchAndYaw

      @Deprecated(forRemoval=true, since="6.11.1") public static float[] getPitchAndYaw(float x, float y, float z)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Unused internally. Scheduled for removal in next major release.
      Returns [ pitch, yaw ]
      Parameters:
      x - x
      y - y
      z - z
      Returns:
      pitch and yaw of x,y,z from 0,0,0
    • atan2

      @Deprecated(forRemoval=true, since="6.11.1") public static final float atan2(float y, float x)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Unused internally. Scheduled for removal in next major release.
    • sqrtApprox

      @Deprecated(forRemoval=true, since="6.11.1") public static float sqrtApprox(float f)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Unused internally. Scheduled for removal in next major release.
    • sqrtApprox

      @Deprecated(forRemoval=true, since="6.11.1") public static double sqrtApprox(double d)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Unused internally. Scheduled for removal in next major release.
    • invSqrt

      @Deprecated(forRemoval=true, since="6.11.1") public static float invSqrt(float x)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Unused internally. Scheduled for removal in next major release.
    • getPositiveId

      public static int getPositiveId(int i)
    • isInteger

      public static boolean isInteger(String str)
    • getSD

      @Deprecated(forRemoval=true, since="6.11.1") public static double getSD(double[] array, double av)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Unused internally. Scheduled for removal in next major release.
    • getSD

      public static double getSD(int[] array, double av)
    • mod

      @Deprecated(forRemoval=true, since="6.11.1") public static int mod(int x, int y)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Unused internally. Scheduled for removal in next major release.
    • unsignedmod

      @Deprecated(forRemoval=true, since="6.11.1") public static int unsignedmod(int x, int y)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Unused internally. Scheduled for removal in next major release.
    • isPowerOfTwo

      @Deprecated(forRemoval=true, since="6.11.1") public static boolean isPowerOfTwo(int number)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Unused internally. Scheduled for removal in next major release.