Package com.plotsquared.core.util
Class MathMan
java.lang.Object
com.plotsquared.core.util.MathMan
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic final floatatan2(float y, float x) static final intaverage(int a, int b) static intfloorMod(int x, int y) static final intgcd(int[] a) static final intgcd(int a, int b) static float[]getDirection(float yaw, float pitch) get the x,y,z unit vector from pitch and yaw specifiedstatic doublegetMean(double[] array) static doublegetMean(int[] array) static float[]getPitchAndYaw(float x, float y, float z) Returns [ pitch, yaw ]static intgetPositiveId(int i) static doublegetSD(double[] array, double av) static doublegetSD(int[] array, double av) static longinverseRound(double val) static floatinvSqrt(float x) static booleanstatic booleanisPowerOfTwo(int number) static intmod(int x, int y) static intpair(short x, short y) static bytepair16(byte x, byte y) static longpairInt(int x, int y) static introundInt(double value) static intsqrt(int x) static doublesqrtApprox(double d) static floatsqrtApprox(float f) static byteunpair16x(byte value) static byteunpair16y(byte value) static intunpairIntX(long pair) static intunpairIntY(long pair) static shortunpairX(int hash) static shortunpairY(int hash) static intunsignedmod(int x, int y)
-
Constructor Details
-
MathMan
public MathMan()
-
-
Method Details
-
gcd
-
gcd
-
pairInt
-
unpairIntX
-
unpairIntY
-
pair16
-
unpair16x
-
unpair16y
-
inverseRound
-
sqrt
-
getMean
-
getMean
-
pair
-
average
-
unpairX
-
unpairY
-
getDirection
get the x,y,z unit vector from pitch and yaw specified- Parameters:
yaw- yawpitch- pitch- Returns:
- x, y, z unit vector
-
floorMod
-
roundInt
-
getPitchAndYaw
Returns [ pitch, yaw ]- Parameters:
x- xy- yz- z- Returns:
- pitch and yaw of x,y,z from 0,0,0
-
atan2
-
sqrtApprox
-
sqrtApprox
-
invSqrt
-
getPositiveId
-
isInteger
-
getSD
-
getSD
-
mod
-
unsignedmod
-
isPowerOfTwo
-