@ParametersAreNonnullByDefault
@MethodsReturnNonnullByDefault
public class MathUtil
extends java.lang.Object
| Constructor and Description |
|---|
MathUtil() |
| Modifier and Type | Method and Description |
|---|---|
static double |
bellCurveProbabilityCyclic(int x,
int mean,
double stdDev,
int spacing)
Generates a gaussian probability with the curves repeatedly positioned in a set distance to each other's center.
|
static int |
ceilDiv(int a,
int b) |
static double |
gaussianProbabilityDensity(double x,
double mean,
double stdDev) |
static boolean |
isPowerOfN(int toTest,
int n) |
static double |
lerp(double a,
double min,
double max) |
static float |
lerp(float a,
float min,
float max) |
static int |
max(int... a) |
static int |
max(int a,
int b) |
static int |
max(int a,
int b,
int c) |
static int |
max(int a,
int b,
int c,
int d) |
static float |
maxIgnoreNan(float... a) |
static int |
min(int... a) |
static int |
min(int a,
int b) |
static int |
min(int a,
int b,
int c) |
static int |
min(int a,
int b,
int c,
int d) |
static int |
packColorARGB(int r,
int g,
int b,
int a) |
static boolean |
rangesIntersect(int min1,
int max1,
int min2,
int max2) |
static int |
to8bitComponent(float value)
Converts normalized 0-1 color component to 8-bit integer
|
static double |
unlerp(double v,
double min,
double max) |
static float |
unlerp(float v,
float min,
float max) |
static float |
unlerp(long v,
long min,
long max) |
public static int ceilDiv(int a,
int b)
public static boolean isPowerOfN(int toTest,
int n)
public static double lerp(double a,
double min,
double max)
public static double unlerp(double v,
double min,
double max)
public static float unlerp(float v,
float min,
float max)
public static float unlerp(long v,
long min,
long max)
public static float lerp(float a,
float min,
float max)
public static int min(int a,
int b)
public static int min(int a,
int b,
int c)
public static int min(int a,
int b,
int c,
int d)
public static int min(int... a)
public static int max(int a,
int b)
public static int max(int a,
int b,
int c)
public static int max(int a,
int b,
int c,
int d)
public static int max(int... a)
public static float maxIgnoreNan(float... a)
public static double gaussianProbabilityDensity(double x,
double mean,
double stdDev)
public static double bellCurveProbabilityCyclic(int x,
int mean,
double stdDev,
int spacing)
x - Value to be evaluatedmean - Center of the first curvestdDev - Standard deviationspacing - Distance between the centers of the curvespublic static boolean rangesIntersect(int min1,
int max1,
int min2,
int max2)
public static int packColorARGB(int r,
int g,
int b,
int a)
public static int to8bitComponent(float value)
value - 0-1 color component