Class MathHelper
float-specific extensions
to Math, linear interpolation (lerp), and color-related methods.
Trigonometric functions defined in this class use the "sine table", a pre-calculated
table of sin(N) (0 <= N < pi * 2).
- Mappings:
Namespace Name named net/minecraft/util/math/MathHelperintermediary net/minecraft/class_3532official bae
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final doubleUsed for the third-order Maclaurin series approximation of the arcsin function, x + x^3/6.private static final double[]Holds values of arcsin(x):ARCSINE_TABLE[i]is equal toMath.arcsin(i / 256.0).private static final intThe total number of entries inARCSINE_TABLEandCOSINE_OF_ARCSINE_TABLE.private static final double[]Holds values of cos(arcsin(x)):COSINE_OF_ARCSINE_TABLE[i]is equal toMath.cos(Math.arcsin(i / 256.0)).static final floatprivate static final floatstatic final floatprivate static final longprivate static final longprivate static final longprivate static final intstatic final floatprivate static final longprivate static final int[]static final floatstatic final floatprivate static final Randomprivate static final doubleA constant for rounding a double to the nearest multiple of 1/256.private static final float[]static final floatstatic final floatTau is equal to2 * PI.static final Vector3fstatic final Vector3fstatic final Vector3f -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic floatabs(float value) static intabs(int value) static doubleabsMax(double a, double b) static floatangleBetween(float first, float second) static booleanapproximatelyEquals(double a, double b) static booleanapproximatelyEquals(float a, float b) static doubleatan2(double y, double x) Returns an approximation ofMath.atan2(y, x).static intbinarySearch(int min, int max, IntPredicate predicate) Finds the minimum value in[min, max)that satisfies the monotonicpredicate.static floatcatmullRom(float delta, float p0, float p1, float p2, float p3) Interpolates a point on a Catmull-Rom Spline.static intceil(double value) static intceil(float value) static intceilDiv(int a, int b) static intceilLog2(int value) Returns ceil(log2(value)).static doubleclamp(double value, double min, double max) static floatclamp(float value, float min, float max) static intclamp(int value, int min, int max) static longclamp(long value, long min, long max) static floatclampAngle(float value, float mean, float delta) Clampsvalue, as an angle, betweenmean - deltaandmean + deltadegrees.static doubleclampedLerp(double start, double end, double delta) static floatclampedLerp(float start, float end, float delta) static doubleclampedMap(double value, double oldStart, double oldEnd, double newStart, double newEnd) Linearly maps a value from one number range to another and clamps the result.static floatclampedMap(float value, float oldStart, float oldEnd, float newStart, float newEnd) Linearly maps a value from one number range to another and clamps the result.static floatcos(float value) static floateaseInOutSine(float value) static floatfastInverseCbrt(float x) Returns an approximation of1 / Math.cbrt(x).static doublefastInverseSqrt(double x) Deprecated.static intfloor(double value) static intfloor(float value) static intfloorDiv(int dividend, int divisor) static intfloorLog2(int value) Returns floor(log2(value)).static doublefloorMod(double dividend, double divisor) static floatfloorMod(float dividend, float divisor) static intfloorMod(int dividend, int divisor) static doublefractionalPart(double value) static floatfractionalPart(float value) static doublegetLerpProgress(double value, double start, double end) Gets the fraction of the way thatvalueis betweenstartandend.static floatgetLerpProgress(float value, float start, float end) static longhashCode(int x, int y, int z) Deprecated.static longDeprecated.static inthsvToArgb(float hue, float saturation, float value, int alpha) static inthsvToRgb(float hue, float saturation, float value) static doublehypot(double a, double b) static floathypot(float a, float b) static intidealHash(int value) static doubleinverseSqrt(double x) static floatinverseSqrt(float x) static booleanisMultipleOf(int a, int b) static booleanisPowerOfTwo(int value) static doublelerp(double delta, double start, double end) static Vec3dstatic floatlerp(float delta, float start, float end) static intlerp(float delta, int start, int end) static doublelerp2(double deltaX, double deltaY, double x0y0, double x1y0, double x0y1, double x1y1) A two-dimensional lerp between values on the 4 corners of the unit square.static doublelerp3(double deltaX, double deltaY, double deltaZ, double x0y0z0, double x1y0z0, double x0y1z0, double x1y1z0, double x0y0z1, double x1y0z1, double x0y1z1, double x1y1z1) A three-dimensional lerp between values on the 8 corners of the unit cube.static doublelerpAngleDegrees(double delta, double start, double end) static floatlerpAngleDegrees(float delta, float start, float end) static floatlerpAngleRadians(float delta, float start, float end) static intlerpPositive(float delta, int start, int end) Returns linear interpolation ofdeltabetweenstartandend, except that for any positivedeltathe value is positive.static longlfloor(double value) static doublemagnitude(double a, double b, double c) static floatmagnitude(float a, float b, float c) static doublemap(double value, double oldStart, double oldEnd, double newStart, double newEnd) Linearly maps a value from one number range to another, unclamped.static floatmap(float value, float oldStart, float oldEnd, float newStart, float newEnd) Linearly maps a value from one number range to another, unclamped.static booleanmethod_34945(Vec3d origin, Vec3d direction, Box box) static doublemethod_34957(double double2) static intmultiplyFraction(Fraction fraction, int multiplier) static floatnextBetween(Random random, float min, float max) static intnextBetween(Random random, int min, int max) Returns a random, uniformly distributed integer value in[min, max].static doublenextDouble(Random random, double min, double max) static floatstatic floatnextGaussian(Random random, float mean, float deviation) static intReturns a random, uniformly distributed integer value in[min, max].static bytepackDegrees(float degrees) static intstatic doubleperlinFade(double value) static doubleperlinFadeDerivative(double value) static UUIDstatic UUIDrandomUuid(Random random) static QuaternionfrotateAround(Vector3f axis, Quaternionf rotation, Quaternionf result) static introundDownToMultiple(double a, int b) Returnsarounded down to the nearest multiple ofb.static introundUpToMultiple(int value, int divisor) Returns a value farther than or as far asvaluefrom zero that is a multiple ofdivisor.static intsign(double value) static floatsin(float value) static intsmallestEncompassingPowerOfTwo(int value) static floatsqrt(float value) static doublesquare(double n) static floatsquare(float n) static intsquare(int n) static longsquare(long n) static doublesquaredHypot(double a, double b) static doublesquaredMagnitude(double a, double b, double c) static floatstepTowards(float from, float to, float step) Steps fromfromtowardsto, changing the value by at moststep.static floatstepUnwrappedAngleTowards(float from, float to, float step) Steps fromfromdegrees towardstodegrees, changing the value by at moststepdegrees.static IntStreamstream(int seed, int lowerBound, int upperBound) static IntStreamstream(int seed, int lowerBound, int upperBound, int steps) static floatsubtractAngles(float start, float end) static floatunpackDegrees(byte packedDegrees) static floatwrap(float value, float maxDeviation) static doublewrapDegrees(double degrees) Wraps an angle in degrees to the interval[-180, 180).static floatwrapDegrees(float degrees) Wraps an angle in degrees to the interval[-180, 180).static intwrapDegrees(int degrees) Wraps an angle in degrees to the interval[-180, 180).static floatwrapDegrees(long degrees)
-
Field Details
-
field_29852
private static final long field_29852- See Also:
- Mappings:
Namespace Name Mixin selector named field_29852Lnet/minecraft/util/math/MathHelper;field_29852:Jintermediary field_29852Lnet/minecraft/class_3532;field_29852:Jofficial kLbae;k:J
-
HALF_PI_RADIANS_SINE_TABLE_INDEX
private static final long HALF_PI_RADIANS_SINE_TABLE_INDEX- See Also:
- Mappings:
Namespace Name Mixin selector named HALF_PI_RADIANS_SINE_TABLE_INDEXLnet/minecraft/util/math/MathHelper;HALF_PI_RADIANS_SINE_TABLE_INDEX:Jintermediary field_29853Lnet/minecraft/class_3532;field_29853:Jofficial lLbae;l:J
-
field_29854
private static final long field_29854- See Also:
- Mappings:
Namespace Name Mixin selector named field_29854Lnet/minecraft/util/math/MathHelper;field_29854:Jintermediary field_29854Lnet/minecraft/class_3532;field_29854:Jofficial mLbae;m:J
-
field_29855
private static final long field_29855- See Also:
- Mappings:
Namespace Name Mixin selector named field_29855Lnet/minecraft/util/math/MathHelper;field_29855:Jintermediary field_29855Lnet/minecraft/class_3532;field_29855:Jofficial nLbae;n:J
-
PI
public static final float PI- See Also:
- Mappings:
Namespace Name Mixin selector named PILnet/minecraft/util/math/MathHelper;PI:Fintermediary field_29844Lnet/minecraft/class_3532;field_29844:Fofficial aLbae;a:F
-
HALF_PI
public static final float HALF_PI- See Also:
- Mappings:
Namespace Name Mixin selector named HALF_PILnet/minecraft/util/math/MathHelper;HALF_PI:Fintermediary field_29845Lnet/minecraft/class_3532;field_29845:Fofficial bLbae;b:F
-
TAU
public static final float TAUTau is equal to2 * PI.- See Also:
- Mappings:
Namespace Name Mixin selector named TAULnet/minecraft/util/math/MathHelper;TAU:Fintermediary field_29846Lnet/minecraft/class_3532;field_29846:Fofficial cLbae;c:F
-
RADIANS_PER_DEGREE
public static final float RADIANS_PER_DEGREE- See Also:
- Mappings:
Namespace Name Mixin selector named RADIANS_PER_DEGREELnet/minecraft/util/math/MathHelper;RADIANS_PER_DEGREE:Fintermediary field_29847Lnet/minecraft/class_3532;field_29847:Fofficial dLbae;d:F
-
DEGREES_PER_RADIAN
public static final float DEGREES_PER_RADIAN- See Also:
- Mappings:
Namespace Name Mixin selector named DEGREES_PER_RADIANLnet/minecraft/util/math/MathHelper;DEGREES_PER_RADIAN:Fintermediary field_29848Lnet/minecraft/class_3532;field_29848:Fofficial eLbae;e:F
-
EPSILON
public static final float EPSILON- See Also:
- Mappings:
Namespace Name Mixin selector named EPSILONLnet/minecraft/util/math/MathHelper;EPSILON:Fintermediary field_29849Lnet/minecraft/class_3532;field_29849:Fofficial fLbae;f:F
-
SQUARE_ROOT_OF_TWO
public static final float SQUARE_ROOT_OF_TWO- Mappings:
Namespace Name Mixin selector named SQUARE_ROOT_OF_TWOLnet/minecraft/util/math/MathHelper;SQUARE_ROOT_OF_TWO:Fintermediary field_15724Lnet/minecraft/class_3532;field_15724:Fofficial gLbae;g:F
-
DEGREES_TO_SINE_TABLE_INDEX
private static final float DEGREES_TO_SINE_TABLE_INDEX- See Also:
- Mappings:
Namespace Name Mixin selector named DEGREES_TO_SINE_TABLE_INDEXLnet/minecraft/util/math/MathHelper;DEGREES_TO_SINE_TABLE_INDEX:Fintermediary field_29856Lnet/minecraft/class_3532;field_29856:Fofficial oLbae;o:F
-
Y_AXIS
- Mappings:
Namespace Name Mixin selector named Y_AXISLnet/minecraft/util/math/MathHelper;Y_AXIS:Lorg/joml/Vector3f;intermediary field_46242Lnet/minecraft/class_3532;field_46242:Lorg/joml/Vector3f;official hLbae;h:Lorg/joml/Vector3f;
-
X_AXIS
- Mappings:
Namespace Name Mixin selector named X_AXISLnet/minecraft/util/math/MathHelper;X_AXIS:Lorg/joml/Vector3f;intermediary field_46243Lnet/minecraft/class_3532;field_46243:Lorg/joml/Vector3f;official iLbae;i:Lorg/joml/Vector3f;
-
Z_AXIS
- Mappings:
Namespace Name Mixin selector named Z_AXISLnet/minecraft/util/math/MathHelper;Z_AXIS:Lorg/joml/Vector3f;intermediary field_46244Lnet/minecraft/class_3532;field_46244:Lorg/joml/Vector3f;official jLbae;j:Lorg/joml/Vector3f;
-
SINE_TABLE
private static final float[] SINE_TABLE- Mappings:
Namespace Name Mixin selector named SINE_TABLELnet/minecraft/util/math/MathHelper;SINE_TABLE:[Fintermediary field_15725Lnet/minecraft/class_3532;field_15725:[Fofficial pLbae;p:[F
-
RANDOM
- Mappings:
Namespace Name Mixin selector named RANDOMLnet/minecraft/util/math/MathHelper;RANDOM:Lnet/minecraft/util/math/random/Random;intermediary field_15726Lnet/minecraft/class_3532;field_15726:Lnet/minecraft/class_5819;official qLbae;q:Lbam;
-
MULTIPLY_DE_BRUIJN_BIT_POSITION
private static final int[] MULTIPLY_DE_BRUIJN_BIT_POSITION- Mappings:
Namespace Name Mixin selector named MULTIPLY_DE_BRUIJN_BIT_POSITIONLnet/minecraft/util/math/MathHelper;MULTIPLY_DE_BRUIJN_BIT_POSITION:[Iintermediary field_15723Lnet/minecraft/class_3532;field_15723:[Iofficial rLbae;r:[I
-
ARCSINE_MACLAURIN_3
private static final double ARCSINE_MACLAURIN_3Used for the third-order Maclaurin series approximation of the arcsin function, x + x^3/6.- See Also:
- Mappings:
Namespace Name Mixin selector named ARCSINE_MACLAURIN_3Lnet/minecraft/util/math/MathHelper;ARCSINE_MACLAURIN_3:Dintermediary field_29857Lnet/minecraft/class_3532;field_29857:Dofficial sLbae;s:D
-
field_29858
private static final int field_29858- See Also:
- Mappings:
Namespace Name Mixin selector named field_29858Lnet/minecraft/util/math/MathHelper;field_29858:Iintermediary field_29858Lnet/minecraft/class_3532;field_29858:Iofficial tLbae;t:I
-
ARCSINE_TABLE_LENGTH
private static final int ARCSINE_TABLE_LENGTHThe total number of entries inARCSINE_TABLEandCOSINE_OF_ARCSINE_TABLE.These tables have 257 elements because they store values for multiples of 1/256 from 0 to 1, inclusive.
- See Also:
- Mappings:
Namespace Name Mixin selector named ARCSINE_TABLE_LENGTHLnet/minecraft/util/math/MathHelper;ARCSINE_TABLE_LENGTH:Iintermediary field_29859Lnet/minecraft/class_3532;field_29859:Iofficial uLbae;u:I
-
ROUNDER_256THS
private static final double ROUNDER_256THSA constant for rounding a double to the nearest multiple of 1/256.When this constant is added to a double that is not too large, then the bits of the result's mantissa reflect the original number times 256. Consequently, adding this constant and then subtracting it rounds such doubles to the nearest multiple of 1/256.
This is used by
atan2(double, double)to produce an index intoARCSINE_TABLEandCOSINE_OF_ARCSINE_TABLE.- Mappings:
Namespace Name Mixin selector named ROUNDER_256THSLnet/minecraft/util/math/MathHelper;ROUNDER_256THS:Dintermediary field_15728Lnet/minecraft/class_3532;field_15728:Dofficial vLbae;v:D
-
ARCSINE_TABLE
private static final double[] ARCSINE_TABLEHolds values of arcsin(x):ARCSINE_TABLE[i]is equal toMath.arcsin(i / 256.0).This is used by
atan2(double, double)to approximate the inverse tangent function.- Mappings:
Namespace Name Mixin selector named ARCSINE_TABLELnet/minecraft/util/math/MathHelper;ARCSINE_TABLE:[Dintermediary field_15727Lnet/minecraft/class_3532;field_15727:[Dofficial wLbae;w:[D
-
COSINE_OF_ARCSINE_TABLE
private static final double[] COSINE_OF_ARCSINE_TABLEHolds values of cos(arcsin(x)):COSINE_OF_ARCSINE_TABLE[i]is equal toMath.cos(Math.arcsin(i / 256.0)).This is used by
atan2(double, double)to approximate the inverse tangent function.- Mappings:
Namespace Name Mixin selector named COSINE_OF_ARCSINE_TABLELnet/minecraft/util/math/MathHelper;COSINE_OF_ARCSINE_TABLE:[Dintermediary field_15722Lnet/minecraft/class_3532;field_15722:[Dofficial xLbae;x:[D
-
-
Constructor Details
-
MathHelper
public MathHelper()
-
-
Method Details
-
sin
public static float sin(float value) - Mappings:
Namespace Name Mixin selector named sinLnet/minecraft/util/math/MathHelper;sin(F)Fintermediary method_15374Lnet/minecraft/class_3532;method_15374(F)Fofficial aLbae;a(F)F
-
cos
public static float cos(float value) - Mappings:
Namespace Name Mixin selector named cosLnet/minecraft/util/math/MathHelper;cos(F)Fintermediary method_15362Lnet/minecraft/class_3532;method_15362(F)Fofficial bLbae;b(F)F
-
sqrt
public static float sqrt(float value) - Mappings:
Namespace Name Mixin selector named sqrtLnet/minecraft/util/math/MathHelper;sqrt(F)Fintermediary method_15355Lnet/minecraft/class_3532;method_15355(F)Fofficial cLbae;c(F)F
-
floor
public static int floor(float value) - Mappings:
Namespace Name Mixin selector named floorLnet/minecraft/util/math/MathHelper;floor(F)Iintermediary method_15375Lnet/minecraft/class_3532;method_15375(F)Iofficial dLbae;d(F)I
-
floor
public static int floor(double value) - Mappings:
Namespace Name Mixin selector named floorLnet/minecraft/util/math/MathHelper;floor(D)Iintermediary method_15357Lnet/minecraft/class_3532;method_15357(D)Iofficial aLbae;a(D)I
-
lfloor
public static long lfloor(double value) - Mappings:
Namespace Name Mixin selector named lfloorLnet/minecraft/util/math/MathHelper;lfloor(D)Jintermediary method_15372Lnet/minecraft/class_3532;method_15372(D)Jofficial bLbae;b(D)J
-
abs
public static float abs(float value) - Mappings:
Namespace Name Mixin selector named absLnet/minecraft/util/math/MathHelper;abs(F)Fintermediary method_15379Lnet/minecraft/class_3532;method_15379(F)Fofficial eLbae;e(F)F
-
abs
public static int abs(int value) - Mappings:
Namespace Name Mixin selector named absLnet/minecraft/util/math/MathHelper;abs(I)Iintermediary method_15382Lnet/minecraft/class_3532;method_15382(I)Iofficial aLbae;a(I)I
-
ceil
public static int ceil(float value) - Mappings:
Namespace Name Mixin selector named ceilLnet/minecraft/util/math/MathHelper;ceil(F)Iintermediary method_15386Lnet/minecraft/class_3532;method_15386(F)Iofficial fLbae;f(F)I
-
ceil
public static int ceil(double value) - Mappings:
Namespace Name Mixin selector named ceilLnet/minecraft/util/math/MathHelper;ceil(D)Iintermediary method_15384Lnet/minecraft/class_3532;method_15384(D)Iofficial cLbae;c(D)I
-
clamp
public static int clamp(int value, int min, int max) - Mappings:
Namespace Name Mixin selector named clampLnet/minecraft/util/math/MathHelper;clamp(III)Iintermediary method_15340Lnet/minecraft/class_3532;method_15340(III)Iofficial aLbae;a(III)I
-
clamp
public static long clamp(long value, long min, long max) - Mappings:
Namespace Name Mixin selector named clampLnet/minecraft/util/math/MathHelper;clamp(JJJ)Jintermediary method_53062Lnet/minecraft/class_3532;method_53062(JJJ)Jofficial aLbae;a(JJJ)J
-
clamp
public static float clamp(float value, float min, float max) - Mappings:
Namespace Name Mixin selector named clampLnet/minecraft/util/math/MathHelper;clamp(FFF)Fintermediary method_15363Lnet/minecraft/class_3532;method_15363(FFF)Fofficial aLbae;a(FFF)F
-
clamp
public static double clamp(double value, double min, double max) - Mappings:
Namespace Name Mixin selector named clampLnet/minecraft/util/math/MathHelper;clamp(DDD)Dintermediary method_15350Lnet/minecraft/class_3532;method_15350(DDD)Dofficial aLbae;a(DDD)D
-
clampedLerp
public static double clampedLerp(double start, double end, double delta) - Mappings:
Namespace Name Mixin selector named clampedLerpLnet/minecraft/util/math/MathHelper;clampedLerp(DDD)Dintermediary method_15390Lnet/minecraft/class_3532;method_15390(DDD)Dofficial bLbae;b(DDD)D
-
clampedLerp
public static float clampedLerp(float start, float end, float delta) - Mappings:
Namespace Name Mixin selector named clampedLerpLnet/minecraft/util/math/MathHelper;clampedLerp(FFF)Fintermediary method_37166Lnet/minecraft/class_3532;method_37166(FFF)Fofficial bLbae;b(FFF)F
-
absMax
public static double absMax(double a, double b) - Mappings:
Namespace Name Mixin selector named absMaxLnet/minecraft/util/math/MathHelper;absMax(DD)Dintermediary method_15391Lnet/minecraft/class_3532;method_15391(DD)Dofficial aLbae;a(DD)D
-
floorDiv
public static int floorDiv(int dividend, int divisor) - Mappings:
Namespace Name Mixin selector named floorDivLnet/minecraft/util/math/MathHelper;floorDiv(II)Iintermediary method_48116Lnet/minecraft/class_3532;method_48116(II)Iofficial aLbae;a(II)I
-
nextInt
Returns a random, uniformly distributed integer value in[min, max]. If the range is empty (i.e.max < min), it returnsmin.- Parameters:
min- the minimum value, inclusivemax- the maximum value, inclusive- Returns:
- a random, uniformly distributed integer value in
[min, max] - Mappings:
Namespace Name Mixin selector named nextIntLnet/minecraft/util/math/MathHelper;nextInt(Lnet/minecraft/util/math/random/Random;II)Iintermediary method_15395Lnet/minecraft/class_3532;method_15395(Lnet/minecraft/class_5819;II)Iofficial aLbae;a(Lbam;II)I
-
nextFloat
- Mappings:
Namespace Name Mixin selector named nextFloatLnet/minecraft/util/math/MathHelper;nextFloat(Lnet/minecraft/util/math/random/Random;FF)Fintermediary method_15344Lnet/minecraft/class_3532;method_15344(Lnet/minecraft/class_5819;FF)Fofficial aLbae;a(Lbam;FF)F
-
nextDouble
- Mappings:
Namespace Name Mixin selector named nextDoubleLnet/minecraft/util/math/MathHelper;nextDouble(Lnet/minecraft/util/math/random/Random;DD)Dintermediary method_15366Lnet/minecraft/class_3532;method_15366(Lnet/minecraft/class_5819;DD)Dofficial aLbae;a(Lbam;DD)D
-
approximatelyEquals
public static boolean approximatelyEquals(float a, float b) - Mappings:
Namespace Name Mixin selector named approximatelyEqualsLnet/minecraft/util/math/MathHelper;approximatelyEquals(FF)Zintermediary method_15347Lnet/minecraft/class_3532;method_15347(FF)Zofficial aLbae;a(FF)Z
-
approximatelyEquals
public static boolean approximatelyEquals(double a, double b) - Mappings:
Namespace Name Mixin selector named approximatelyEqualsLnet/minecraft/util/math/MathHelper;approximatelyEquals(DD)Zintermediary method_20390Lnet/minecraft/class_3532;method_20390(DD)Zofficial bLbae;b(DD)Z
-
floorMod
public static int floorMod(int dividend, int divisor) - Mappings:
Namespace Name Mixin selector named floorModLnet/minecraft/util/math/MathHelper;floorMod(II)Iintermediary method_15387Lnet/minecraft/class_3532;method_15387(II)Iofficial bLbae;b(II)I
-
floorMod
public static float floorMod(float dividend, float divisor) - Mappings:
Namespace Name Mixin selector named floorModLnet/minecraft/util/math/MathHelper;floorMod(FF)Fintermediary method_15341Lnet/minecraft/class_3532;method_15341(FF)Fofficial bLbae;b(FF)F
-
floorMod
public static double floorMod(double dividend, double divisor) - Mappings:
Namespace Name Mixin selector named floorModLnet/minecraft/util/math/MathHelper;floorMod(DD)Dintermediary method_15367Lnet/minecraft/class_3532;method_15367(DD)Dofficial cLbae;c(DD)D
-
isMultipleOf
public static boolean isMultipleOf(int a, int b) - Mappings:
Namespace Name Mixin selector named isMultipleOfLnet/minecraft/util/math/MathHelper;isMultipleOf(II)Zintermediary method_48117Lnet/minecraft/class_3532;method_48117(II)Zofficial cLbae;c(II)Z
-
packDegrees
public static byte packDegrees(float degrees) - Mappings:
Namespace Name Mixin selector named packDegreesLnet/minecraft/util/math/MathHelper;packDegrees(F)Bintermediary method_62995Lnet/minecraft/class_3532;method_62995(F)Bofficial gLbae;g(F)B
-
unpackDegrees
public static float unpackDegrees(byte packedDegrees) - Mappings:
Namespace Name Mixin selector named unpackDegreesLnet/minecraft/util/math/MathHelper;unpackDegrees(B)Fintermediary method_62994Lnet/minecraft/class_3532;method_62994(B)Fofficial aLbae;a(B)F
-
wrapDegrees
public static int wrapDegrees(int degrees) Wraps an angle in degrees to the interval[-180, 180).- Mappings:
Namespace Name Mixin selector named wrapDegreesLnet/minecraft/util/math/MathHelper;wrapDegrees(I)Iintermediary method_15392Lnet/minecraft/class_3532;method_15392(I)Iofficial bLbae;b(I)I
-
wrapDegrees
public static float wrapDegrees(long degrees) - Mappings:
Namespace Name Mixin selector named wrapDegreesLnet/minecraft/util/math/MathHelper;wrapDegrees(J)Fintermediary method_61343Lnet/minecraft/class_3532;method_61343(J)Fofficial aLbae;a(J)F
-
wrapDegrees
public static float wrapDegrees(float degrees) Wraps an angle in degrees to the interval[-180, 180).- Mappings:
Namespace Name Mixin selector named wrapDegreesLnet/minecraft/util/math/MathHelper;wrapDegrees(F)Fintermediary method_15393Lnet/minecraft/class_3532;method_15393(F)Fofficial hLbae;h(F)F
-
wrapDegrees
public static double wrapDegrees(double degrees) Wraps an angle in degrees to the interval[-180, 180).- Mappings:
Namespace Name Mixin selector named wrapDegreesLnet/minecraft/util/math/MathHelper;wrapDegrees(D)Dintermediary method_15338Lnet/minecraft/class_3532;method_15338(D)Dofficial dLbae;d(D)D
-
subtractAngles
public static float subtractAngles(float start, float end) - Mappings:
Namespace Name Mixin selector named subtractAnglesLnet/minecraft/util/math/MathHelper;subtractAngles(FF)Fintermediary method_15381Lnet/minecraft/class_3532;method_15381(FF)Fofficial cLbae;c(FF)F
-
angleBetween
public static float angleBetween(float first, float second) - Mappings:
Namespace Name Mixin selector named angleBetweenLnet/minecraft/util/math/MathHelper;angleBetween(FF)Fintermediary method_15356Lnet/minecraft/class_3532;method_15356(FF)Fofficial dLbae;d(FF)F
-
clampAngle
public static float clampAngle(float value, float mean, float delta) Clampsvalue, as an angle, betweenmean - deltaandmean + deltadegrees.- Parameters:
value- the value to clampmean- the mean value of the clamp angle rangedelta- the maximum difference allowed from the mean, must not be negative- Returns:
- the clamped
value - Mappings:
Namespace Name Mixin selector named clampAngleLnet/minecraft/util/math/MathHelper;clampAngle(FFF)Fintermediary method_20306Lnet/minecraft/class_3532;method_20306(FFF)Fofficial cLbae;c(FFF)F
-
stepTowards
public static float stepTowards(float from, float to, float step) Steps fromfromtowardsto, changing the value by at moststep.- Mappings:
Namespace Name Mixin selector named stepTowardsLnet/minecraft/util/math/MathHelper;stepTowards(FFF)Fintermediary method_15348Lnet/minecraft/class_3532;method_15348(FFF)Fofficial dLbae;d(FFF)F
-
stepUnwrappedAngleTowards
public static float stepUnwrappedAngleTowards(float from, float to, float step) Steps fromfromdegrees towardstodegrees, changing the value by at moststepdegrees.- Mappings:
Namespace Name Mixin selector named stepUnwrappedAngleTowardsLnet/minecraft/util/math/MathHelper;stepUnwrappedAngleTowards(FFF)Fintermediary method_15388Lnet/minecraft/class_3532;method_15388(FFF)Fofficial eLbae;e(FFF)F
-
parseInt
- Mappings:
Namespace Name Mixin selector named parseIntLnet/minecraft/util/math/MathHelper;parseInt(Ljava/lang/String;I)Iintermediary method_15343Lnet/minecraft/class_3532;method_15343(Ljava/lang/String;I)Iofficial aLbae;a(Ljava/lang/String;I)I
-
smallestEncompassingPowerOfTwo
public static int smallestEncompassingPowerOfTwo(int value) - Mappings:
Namespace Name Mixin selector named smallestEncompassingPowerOfTwoLnet/minecraft/util/math/MathHelper;smallestEncompassingPowerOfTwo(I)Iintermediary method_15339Lnet/minecraft/class_3532;method_15339(I)Iofficial cLbae;c(I)I
-
isPowerOfTwo
public static boolean isPowerOfTwo(int value) - Mappings:
Namespace Name Mixin selector named isPowerOfTwoLnet/minecraft/util/math/MathHelper;isPowerOfTwo(I)Zintermediary method_15352Lnet/minecraft/class_3532;method_15352(I)Zofficial dLbae;d(I)Z
-
ceilLog2
public static int ceilLog2(int value) Returns ceil(log2(value)).The vanilla implementation uses the de Bruijn sequence.
- Parameters:
value- the input value- Returns:
- ceil(log2(
value)) - See Also:
- Mappings:
Namespace Name Mixin selector named ceilLog2Lnet/minecraft/util/math/MathHelper;ceilLog2(I)Iintermediary method_15342Lnet/minecraft/class_3532;method_15342(I)Iofficial eLbae;e(I)I
-
floorLog2
public static int floorLog2(int value) Returns floor(log2(value)).The vanilla implementation uses the de Bruijn sequence.
- Parameters:
value- the input value- Returns:
- floor(log2(
value)) - See Also:
- Mappings:
Namespace Name Mixin selector named floorLog2Lnet/minecraft/util/math/MathHelper;floorLog2(I)Iintermediary method_15351Lnet/minecraft/class_3532;method_15351(I)Iofficial fLbae;f(I)I
-
fractionalPart
public static float fractionalPart(float value) - Mappings:
Namespace Name Mixin selector named fractionalPartLnet/minecraft/util/math/MathHelper;fractionalPart(F)Fintermediary method_22450Lnet/minecraft/class_3532;method_22450(F)Fofficial iLbae;i(F)F
-
fractionalPart
public static double fractionalPart(double value) - Mappings:
Namespace Name Mixin selector named fractionalPartLnet/minecraft/util/math/MathHelper;fractionalPart(D)Dintermediary method_15385Lnet/minecraft/class_3532;method_15385(D)Dofficial eLbae;e(D)D
-
hashCode
Deprecated.- Mappings:
Namespace Name Mixin selector named hashCodeLnet/minecraft/util/math/MathHelper;hashCode(Lnet/minecraft/util/math/Vec3i;)Jintermediary method_15389Lnet/minecraft/class_3532;method_15389(Lnet/minecraft/class_2382;)Jofficial aLbae;a(Lkl;)J
-
hashCode
Deprecated.- Mappings:
Namespace Name Mixin selector named hashCodeLnet/minecraft/util/math/MathHelper;hashCode(III)Jintermediary method_15371Lnet/minecraft/class_3532;method_15371(III)Jofficial bLbae;b(III)J
-
randomUuid
- Mappings:
Namespace Name Mixin selector named randomUuidLnet/minecraft/util/math/MathHelper;randomUuid(Lnet/minecraft/util/math/random/Random;)Ljava/util/UUID;intermediary method_15378Lnet/minecraft/class_3532;method_15378(Lnet/minecraft/class_5819;)Ljava/util/UUID;official aLbae;a(Lbam;)Ljava/util/UUID;
-
randomUuid
- Mappings:
Namespace Name Mixin selector named randomUuidLnet/minecraft/util/math/MathHelper;randomUuid()Ljava/util/UUID;intermediary method_15394Lnet/minecraft/class_3532;method_15394()Ljava/util/UUID;official aLbae;a()Ljava/util/UUID;
-
getLerpProgress
public static double getLerpProgress(double value, double start, double end) Gets the fraction of the way thatvalueis betweenstartandend. This is the delta value needed to lerp betweenstartandendto getvalue. In other words,getLerpProgress(lerp(delta, start, end), start, end) == delta.- Parameters:
value- the result of the lerp functionstart- the value interpolated fromend- the value interpolated to- Mappings:
Namespace Name Mixin selector named getLerpProgressLnet/minecraft/util/math/MathHelper;getLerpProgress(DDD)Dintermediary method_15370Lnet/minecraft/class_3532;method_15370(DDD)Dofficial cLbae;c(DDD)D
-
getLerpProgress
public static float getLerpProgress(float value, float start, float end) - Mappings:
Namespace Name Mixin selector named getLerpProgressLnet/minecraft/util/math/MathHelper;getLerpProgress(FFF)Fintermediary method_37960Lnet/minecraft/class_3532;method_37960(FFF)Fofficial fLbae;f(FFF)F
-
method_34945
- Mappings:
Namespace Name Mixin selector named method_34945Lnet/minecraft/util/math/MathHelper;method_34945(Lnet/minecraft/util/math/Vec3d;Lnet/minecraft/util/math/Vec3d;Lnet/minecraft/util/math/Box;)Zintermediary method_34945Lnet/minecraft/class_3532;method_34945(Lnet/minecraft/class_243;Lnet/minecraft/class_243;Lnet/minecraft/class_238;)Zofficial aLbae;a(Lfbx;Lfbx;Lfbs;)Z
-
atan2
public static double atan2(double y, double x) Returns an approximation ofMath.atan2(y, x).- Returns:
- an approximation of
Math.atan2(y, x) - Implementation Note:
- This implementation transforms the arguments such that they
lie in the first quadrant. If
y > x, thenxandyare swapped to minimize the error of the initial approximation.xandyare normalized, and an initial approximation of the result and the sine of the deviation from the true value are obtained using theARCSINE_TABLEandCOSINE_OF_ARCSINE_TABLElookup tables. The error itself is approximated using the third-order Maclaurin series polynomial for arcsin. Finally, the implementation undoes any transformations that were performed initially. - Mappings:
Namespace Name Mixin selector named atan2Lnet/minecraft/util/math/MathHelper;atan2(DD)Dintermediary method_15349Lnet/minecraft/class_3532;method_15349(DD)Dofficial dLbae;d(DD)D
-
inverseSqrt
public static float inverseSqrt(float x) - Mappings:
Namespace Name Mixin selector named inverseSqrtLnet/minecraft/util/math/MathHelper;inverseSqrt(F)Fintermediary method_48119Lnet/minecraft/class_3532;method_48119(F)Fofficial jLbae;j(F)F
-
inverseSqrt
public static double inverseSqrt(double x) - Mappings:
Namespace Name Mixin selector named inverseSqrtLnet/minecraft/util/math/MathHelper;inverseSqrt(D)Dintermediary method_48118Lnet/minecraft/class_3532;method_48118(D)Dofficial fLbae;f(D)D
-
fastInverseSqrt
Deprecated.Returns an approximation of1 / Math.sqrt(x).- Returns:
- an approximation of
1 / Math.sqrt(x) - Mappings:
Namespace Name Mixin selector named fastInverseSqrtLnet/minecraft/util/math/MathHelper;fastInverseSqrt(D)Dintermediary method_15345Lnet/minecraft/class_3532;method_15345(D)Dofficial gLbae;g(D)D
-
fastInverseCbrt
public static float fastInverseCbrt(float x) Returns an approximation of1 / Math.cbrt(x).- Returns:
- an approximation of
1 / Math.cbrt(x) - Mappings:
Namespace Name Mixin selector named fastInverseCbrtLnet/minecraft/util/math/MathHelper;fastInverseCbrt(F)Fintermediary method_23278Lnet/minecraft/class_3532;method_23278(F)Fofficial kLbae;k(F)F
-
hsvToRgb
public static int hsvToRgb(float hue, float saturation, float value) - Mappings:
Namespace Name Mixin selector named hsvToRgbLnet/minecraft/util/math/MathHelper;hsvToRgb(FFF)Iintermediary method_15369Lnet/minecraft/class_3532;method_15369(FFF)Iofficial gLbae;g(FFF)I
-
hsvToArgb
public static int hsvToArgb(float hue, float saturation, float value, int alpha) - Mappings:
Namespace Name Mixin selector named hsvToArgbLnet/minecraft/util/math/MathHelper;hsvToArgb(FFFI)Iintermediary method_60599Lnet/minecraft/class_3532;method_60599(FFFI)Iofficial aLbae;a(FFFI)I
-
idealHash
public static int idealHash(int value) - Mappings:
Namespace Name Mixin selector named idealHashLnet/minecraft/util/math/MathHelper;idealHash(I)Iintermediary method_15354Lnet/minecraft/class_3532;method_15354(I)Iofficial gLbae;g(I)I
-
binarySearch
Finds the minimum value in[min, max)that satisfies the monotonicpredicate.The
predicatemust be monotonic, i.e. if for anya,predicate.test(a)istrue, then for allb > a,predicate.test(b)must also betrue.Examples:
binarySearch(3, 7, x -> true)returns3.binarySearch(3, 7, x -> x >= 5)returns5.binarySearch(3, 7, x -> false)returns7.
- Parameters:
min- the minimum value (inclusive) to be testedmax- the maximum value (exclusive) to be testedpredicate- the predicate that returnstruefor integers greater than or equal to the value to be searched for- Returns:
- the minimum value if such value is found, otherwise
max - Mappings:
Namespace Name Mixin selector named binarySearchLnet/minecraft/util/math/MathHelper;binarySearch(IILjava/util/function/IntPredicate;)Iintermediary method_15360Lnet/minecraft/class_3532;method_15360(IILjava/util/function/IntPredicate;)Iofficial aLbae;a(IILjava/util/function/IntPredicate;)I
-
lerp
public static int lerp(float delta, int start, int end) - Mappings:
Namespace Name Mixin selector named lerpLnet/minecraft/util/math/MathHelper;lerp(FII)Iintermediary method_48781Lnet/minecraft/class_3532;method_48781(FII)Iofficial aLbae;a(FII)I
-
lerpPositive
public static int lerpPositive(float delta, int start, int end) Returns linear interpolation ofdeltabetweenstartandend, except that for any positivedeltathe value is positive.Like
lerp(float, int, int),lerpPositive(0, 0, 10)returns0. However, if the delta is0.01f, thelerpmethod would return0since0.01 * 10floored is0. This method returns1in this situation.- Returns:
- linear interpolation of
deltabetweenstartandend, except that for any positivedeltathe value is positive - See Also:
- API Note:
- This is used to calculate redstone comparator output and boss bar percentage.
- Mappings:
Namespace Name Mixin selector named lerpPositiveLnet/minecraft/util/math/MathHelper;lerpPositive(FII)Iintermediary method_53063Lnet/minecraft/class_3532;method_53063(FII)Iofficial bLbae;b(FII)I
-
lerp
public static float lerp(float delta, float start, float end) - Mappings:
Namespace Name Mixin selector named lerpLnet/minecraft/util/math/MathHelper;lerp(FFF)Fintermediary method_16439Lnet/minecraft/class_3532;method_16439(FFF)Fofficial hLbae;h(FFF)F
-
lerp
- Mappings:
Namespace Name Mixin selector named lerpLnet/minecraft/util/math/MathHelper;lerp(DLnet/minecraft/util/math/Vec3d;Lnet/minecraft/util/math/Vec3d;)Lnet/minecraft/util/math/Vec3d;intermediary method_61342Lnet/minecraft/class_3532;method_61342(DLnet/minecraft/class_243;Lnet/minecraft/class_243;)Lnet/minecraft/class_243;official aLbae;a(DLfbx;Lfbx;)Lfbx;
-
lerp
public static double lerp(double delta, double start, double end) - Mappings:
Namespace Name Mixin selector named lerpLnet/minecraft/util/math/MathHelper;lerp(DDD)Dintermediary method_16436Lnet/minecraft/class_3532;method_16436(DDD)Dofficial dLbae;d(DDD)D
-
lerp2
public static double lerp2(double deltaX, double deltaY, double x0y0, double x1y0, double x0y1, double x1y1) A two-dimensional lerp between values on the 4 corners of the unit square. Arbitrary values are specified for the corners and the output is interpolated between them.- Parameters:
deltaX- the x-coordinate on the unit squaredeltaY- the y-coordinate on the unit squarex0y0- the output ifdeltaXis 0 anddeltaYis 0x1y0- the output ifdeltaXis 1 anddeltaYis 0x0y1- the output ifdeltaXis 0 anddeltaYis 1x1y1- the output ifdeltaXis 1 anddeltaYis 1- Mappings:
Namespace Name Mixin selector named lerp2Lnet/minecraft/util/math/MathHelper;lerp2(DDDDDD)Dintermediary method_16437Lnet/minecraft/class_3532;method_16437(DDDDDD)Dofficial aLbae;a(DDDDDD)D
-
lerp3
public static double lerp3(double deltaX, double deltaY, double deltaZ, double x0y0z0, double x1y0z0, double x0y1z0, double x1y1z0, double x0y0z1, double x1y0z1, double x0y1z1, double x1y1z1) A three-dimensional lerp between values on the 8 corners of the unit cube. Arbitrary values are specified for the corners and the output is interpolated between them.- Parameters:
deltaX- the x-coordinate on the unit cubedeltaY- the y-coordinate on the unit cubedeltaZ- the z-coordinate on the unit cubex0y0z0- the output ifdeltaXis 0,deltaYis 0 anddeltaZis 0x1y0z0- the output ifdeltaXis 1,deltaYis 0 anddeltaZis 0x0y1z0- the output ifdeltaXis 0,deltaYis 1 anddeltaZis 0x1y1z0- the output ifdeltaXis 1,deltaYis 1 anddeltaZis 0x0y0z1- the output ifdeltaXis 0,deltaYis 0 anddeltaZis 1x1y0z1- the output ifdeltaXis 1,deltaYis 0 anddeltaZis 1x0y1z1- the output ifdeltaXis 0,deltaYis 1 anddeltaZis 1x1y1z1- the output ifdeltaXis 1,deltaYis 1 anddeltaZis 1- Mappings:
Namespace Name Mixin selector named lerp3Lnet/minecraft/util/math/MathHelper;lerp3(DDDDDDDDDDD)Dintermediary method_16438Lnet/minecraft/class_3532;method_16438(DDDDDDDDDDD)Dofficial aLbae;a(DDDDDDDDDDD)D
-
catmullRom
public static float catmullRom(float delta, float p0, float p1, float p2, float p3) Interpolates a point on a Catmull-Rom Spline. This spline has a property that if there are two splines with argumentsp0, p1, p2, p3andp1, p2, p3, p4, the resulting curve will have a continuous first derivative atp2, where the two input curves connect. For higher-dimensional curves, the interpolation on the curve is done component-wise: for inputsdelta, (p0x, p0y), (p1x, p1y), (p2x, p2y), (p3x, p3y), the output is(catmullRom(delta, p0x, p1x, p2x, p3x), catmullRom(delta, p0y, p1y, p2y, p3y)).- Parameters:
delta- the progress along the interpolationp0- the previous data point to assist in curve-smoothingp1- the output ifdeltais 0p2- the output ifdeltais 1p3- the next data point to assist in curve-smoothing- See Also:
- Mappings:
Namespace Name Mixin selector named catmullRomLnet/minecraft/util/math/MathHelper;catmullRom(FFFFF)Fintermediary method_41303Lnet/minecraft/class_3532;method_41303(FFFFF)Fofficial aLbae;a(FFFFF)F
-
perlinFade
public static double perlinFade(double value) - Mappings:
Namespace Name Mixin selector named perlinFadeLnet/minecraft/util/math/MathHelper;perlinFade(D)Dintermediary method_16435Lnet/minecraft/class_3532;method_16435(D)Dofficial hLbae;h(D)D
-
perlinFadeDerivative
public static double perlinFadeDerivative(double value) - Mappings:
Namespace Name Mixin selector named perlinFadeDerivativeLnet/minecraft/util/math/MathHelper;perlinFadeDerivative(D)Dintermediary method_34956Lnet/minecraft/class_3532;method_34956(D)Dofficial iLbae;i(D)D
-
sign
public static int sign(double value) - Mappings:
Namespace Name Mixin selector named signLnet/minecraft/util/math/MathHelper;sign(D)Iintermediary method_17822Lnet/minecraft/class_3532;method_17822(D)Iofficial jLbae;j(D)I
-
lerpAngleDegrees
public static float lerpAngleDegrees(float delta, float start, float end) - Mappings:
Namespace Name Mixin selector named lerpAngleDegreesLnet/minecraft/util/math/MathHelper;lerpAngleDegrees(FFF)Fintermediary method_17821Lnet/minecraft/class_3532;method_17821(FFF)Fofficial iLbae;i(FFF)F
-
lerpAngleDegrees
public static double lerpAngleDegrees(double delta, double start, double end) - Mappings:
Namespace Name Mixin selector named lerpAngleDegreesLnet/minecraft/util/math/MathHelper;lerpAngleDegrees(DDD)Dintermediary method_52468Lnet/minecraft/class_3532;method_52468(DDD)Dofficial eLbae;e(DDD)D
-
lerpAngleRadians
public static float lerpAngleRadians(float delta, float start, float end) - Mappings:
Namespace Name Mixin selector named lerpAngleRadiansLnet/minecraft/util/math/MathHelper;lerpAngleRadians(FFF)Fintermediary method_61345Lnet/minecraft/class_3532;method_61345(FFF)Fofficial jLbae;j(FFF)F
-
wrap
public static float wrap(float value, float maxDeviation) - Mappings:
Namespace Name Mixin selector named wrapLnet/minecraft/util/math/MathHelper;wrap(FF)Fintermediary method_24504Lnet/minecraft/class_3532;method_24504(FF)Fofficial eLbae;e(FF)F
-
square
public static float square(float n) - Mappings:
Namespace Name Mixin selector named squareLnet/minecraft/util/math/MathHelper;square(F)Fintermediary method_27285Lnet/minecraft/class_3532;method_27285(F)Fofficial lLbae;l(F)F
-
square
public static double square(double n) - Mappings:
Namespace Name Mixin selector named squareLnet/minecraft/util/math/MathHelper;square(D)Dintermediary method_33723Lnet/minecraft/class_3532;method_33723(D)Dofficial kLbae;k(D)D
-
square
public static int square(int n) - Mappings:
Namespace Name Mixin selector named squareLnet/minecraft/util/math/MathHelper;square(I)Iintermediary method_34954Lnet/minecraft/class_3532;method_34954(I)Iofficial hLbae;h(I)I
-
square
public static long square(long n) - Mappings:
Namespace Name Mixin selector named squareLnet/minecraft/util/math/MathHelper;square(J)Jintermediary method_38652Lnet/minecraft/class_3532;method_38652(J)Jofficial bLbae;b(J)J
-
clampedMap
public static double clampedMap(double value, double oldStart, double oldEnd, double newStart, double newEnd) Linearly maps a value from one number range to another and clamps the result.- Parameters:
value- the input valueoldStart- the starting value of the original rangeoldEnd- the end value of the original rangenewStart- the starting value of the new rangenewEnd- the end value of the new range- Returns:
- the mapped value, clamped between
newStartandnewEnd - See Also:
- Mappings:
Namespace Name Mixin selector named clampedMapLnet/minecraft/util/math/MathHelper;clampedMap(DDDDD)Dintermediary method_32854Lnet/minecraft/class_3532;method_32854(DDDDD)Dofficial aLbae;a(DDDDD)D
-
clampedMap
public static float clampedMap(float value, float oldStart, float oldEnd, float newStart, float newEnd) Linearly maps a value from one number range to another and clamps the result.- Parameters:
value- the input valueoldStart- the starting value of the original rangeoldEnd- the end value of the original rangenewStart- the starting value of the new rangenewEnd- the end value of the new range- Returns:
- the mapped value, clamped between
newStartandnewEnd - See Also:
- Mappings:
Namespace Name Mixin selector named clampedMapLnet/minecraft/util/math/MathHelper;clampedMap(FFFFF)Fintermediary method_37958Lnet/minecraft/class_3532;method_37958(FFFFF)Fofficial bLbae;b(FFFFF)F
-
map
public static double map(double value, double oldStart, double oldEnd, double newStart, double newEnd) Linearly maps a value from one number range to another, unclamped.For the return value
result,getLerpProgress(value, oldStart, oldEnd)is approximately equal togetLerpProgress(result, newStart, newEnd)(accounting for floating point errors).- Parameters:
value- the input valueoldStart- the starting value of the original rangeoldEnd- the end value of the original rangenewStart- the starting value of the new rangenewEnd- the end value of the new range- Returns:
- the mapped value
- Mappings:
Namespace Name Mixin selector named mapLnet/minecraft/util/math/MathHelper;map(DDDDD)Dintermediary method_33722Lnet/minecraft/class_3532;method_33722(DDDDD)Dofficial bLbae;b(DDDDD)D
-
map
public static float map(float value, float oldStart, float oldEnd, float newStart, float newEnd) Linearly maps a value from one number range to another, unclamped.For the return value
result,getLerpProgress(value, oldStart, oldEnd)is approximately equal togetLerpProgress(result, newStart, newEnd)(accounting for floating point errors).- Parameters:
value- the input valueoldStart- the starting value of the original rangeoldEnd- the end value of the original rangenewStart- the starting value of the new rangenewEnd- the end value of the new range- Returns:
- the mapped value
- Mappings:
Namespace Name Mixin selector named mapLnet/minecraft/util/math/MathHelper;map(FFFFF)Fintermediary method_37959Lnet/minecraft/class_3532;method_37959(FFFFF)Fofficial cLbae;c(FFFFF)F
-
method_34957
public static double method_34957(double double2) - Mappings:
Namespace Name Mixin selector named method_34957Lnet/minecraft/util/math/MathHelper;method_34957(D)Dintermediary method_34957Lnet/minecraft/class_3532;method_34957(D)Dofficial lLbae;l(D)D
-
roundUpToMultiple
public static int roundUpToMultiple(int value, int divisor) Returns a value farther than or as far asvaluefrom zero that is a multiple ofdivisor.- Mappings:
Namespace Name Mixin selector named roundUpToMultipleLnet/minecraft/util/math/MathHelper;roundUpToMultiple(II)Iintermediary method_28139Lnet/minecraft/class_3532;method_28139(II)Iofficial dLbae;d(II)I
-
ceilDiv
public static int ceilDiv(int a, int b) - Mappings:
Namespace Name Mixin selector named ceilDivLnet/minecraft/util/math/MathHelper;ceilDiv(II)Iintermediary method_38788Lnet/minecraft/class_3532;method_38788(II)Iofficial eLbae;e(II)I
-
nextBetween
Returns a random, uniformly distributed integer value in[min, max].- Parameters:
min- the minimum value, inclusivemax- the maximum value, inclusive- Returns:
- a random, uniformly distributed integer value in
[min, max] - Throws:
IllegalArgumentException- if the range is empty (i.e.max < min)- Mappings:
Namespace Name Mixin selector named nextBetweenLnet/minecraft/util/math/MathHelper;nextBetween(Lnet/minecraft/util/math/random/Random;II)Iintermediary method_32751Lnet/minecraft/class_3532;method_32751(Lnet/minecraft/class_5819;II)Iofficial bLbae;b(Lbam;II)I
-
nextBetween
- Mappings:
Namespace Name Mixin selector named nextBetweenLnet/minecraft/util/math/MathHelper;nextBetween(Lnet/minecraft/util/math/random/Random;FF)Fintermediary method_32750Lnet/minecraft/class_3532;method_32750(Lnet/minecraft/class_5819;FF)Fofficial bLbae;b(Lbam;FF)F
-
nextGaussian
- Mappings:
Namespace Name Mixin selector named nextGaussianLnet/minecraft/util/math/MathHelper;nextGaussian(Lnet/minecraft/util/math/random/Random;FF)Fintermediary method_32855Lnet/minecraft/class_3532;method_32855(Lnet/minecraft/class_5819;FF)Fofficial cLbae;c(Lbam;FF)F
-
squaredHypot
public static double squaredHypot(double a, double b) - Mappings:
Namespace Name Mixin selector named squaredHypotLnet/minecraft/util/math/MathHelper;squaredHypot(DD)Dintermediary method_41189Lnet/minecraft/class_3532;method_41189(DD)Dofficial eLbae;e(DD)D
-
hypot
public static double hypot(double a, double b) - Mappings:
Namespace Name Mixin selector named hypotLnet/minecraft/util/math/MathHelper;hypot(DD)Dintermediary method_39241Lnet/minecraft/class_3532;method_39241(DD)Dofficial fLbae;f(DD)D
-
hypot
public static float hypot(float a, float b) - Mappings:
Namespace Name Mixin selector named hypotLnet/minecraft/util/math/MathHelper;hypot(FF)Fintermediary method_61344Lnet/minecraft/class_3532;method_61344(FF)Fofficial fLbae;f(FF)F
-
squaredMagnitude
public static double squaredMagnitude(double a, double b, double c) - Mappings:
Namespace Name Mixin selector named squaredMagnitudeLnet/minecraft/util/math/MathHelper;squaredMagnitude(DDD)Dintermediary method_41190Lnet/minecraft/class_3532;method_41190(DDD)Dofficial fLbae;f(DDD)D
-
magnitude
public static double magnitude(double a, double b, double c) - Mappings:
Namespace Name Mixin selector named magnitudeLnet/minecraft/util/math/MathHelper;magnitude(DDD)Dintermediary method_33825Lnet/minecraft/class_3532;method_33825(DDD)Dofficial gLbae;g(DDD)D
-
magnitude
public static float magnitude(float a, float b, float c) - Mappings:
Namespace Name Mixin selector named magnitudeLnet/minecraft/util/math/MathHelper;magnitude(FFF)Fintermediary method_60677Lnet/minecraft/class_3532;method_60677(FFF)Fofficial kLbae;k(FFF)F
-
roundDownToMultiple
public static int roundDownToMultiple(double a, int b) Returnsarounded down to the nearest multiple ofb.- Returns:
arounded down to the nearest multiple ofb- Mappings:
Namespace Name Mixin selector named roundDownToMultipleLnet/minecraft/util/math/MathHelper;roundDownToMultiple(DI)Iintermediary method_38961Lnet/minecraft/class_3532;method_38961(DI)Iofficial aLbae;a(DI)I
-
stream
- Mappings:
Namespace Name Mixin selector named streamLnet/minecraft/util/math/MathHelper;stream(III)Ljava/util/stream/IntStream;intermediary method_42120Lnet/minecraft/class_3532;method_42120(III)Ljava/util/stream/IntStream;official cLbae;c(III)Ljava/util/stream/IntStream;
-
stream
- Mappings:
Namespace Name Mixin selector named streamLnet/minecraft/util/math/MathHelper;stream(IIII)Ljava/util/stream/IntStream;intermediary method_42117Lnet/minecraft/class_3532;method_42117(IIII)Ljava/util/stream/IntStream;official aLbae;a(IIII)Ljava/util/stream/IntStream;
-
rotateAround
- Mappings:
Namespace Name Mixin selector named rotateAroundLnet/minecraft/util/math/MathHelper;rotateAround(Lorg/joml/Vector3f;Lorg/joml/Quaternionf;Lorg/joml/Quaternionf;)Lorg/joml/Quaternionf;intermediary method_53948Lnet/minecraft/class_3532;method_53948(Lorg/joml/Vector3f;Lorg/joml/Quaternionf;Lorg/joml/Quaternionf;)Lorg/joml/Quaternionf;official aLbae;a(Lorg/joml/Vector3f;Lorg/joml/Quaternionf;Lorg/joml/Quaternionf;)Lorg/joml/Quaternionf;
-
multiplyFraction
- Mappings:
Namespace Name Mixin selector named multiplyFractionLnet/minecraft/util/math/MathHelper;multiplyFraction(Lorg/apache/commons/lang3/math/Fraction;I)Iintermediary method_59515Lnet/minecraft/class_3532;method_59515(Lorg/apache/commons/lang3/math/Fraction;I)Iofficial aLbae;a(Lorg/apache/commons/lang3/math/Fraction;I)I
-
easeInOutSine
public static float easeInOutSine(float value) - Mappings:
Namespace Name Mixin selector named easeInOutSineLnet/minecraft/util/math/MathHelper;easeInOutSine(F)Fintermediary method_61346Lnet/minecraft/class_3532;method_61346(F)Fofficial mLbae;m(F)F
-