public class MathHelper
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static double |
phi |
static double |
pi |
static double[] |
SIN_TABLE |
static double |
sqrt2 |
static double |
todeg |
static double |
torad |
| Constructor and Description |
|---|
MathHelper() |
| Modifier and Type | Method and Description |
|---|---|
static double |
approachExp(double a,
double b,
double ratio) |
static double |
approachExp(double a,
double b,
double ratio,
double cap) |
static int |
approachExpI(int a,
int b,
double ratio) |
static double |
approachLinear(double a,
double b,
double max) |
static float |
approachLinear(float a,
float b,
float max) |
static boolean |
between(double a,
double x,
double b) |
static double |
clip(double value,
double min,
double max) |
static int |
compare(double a,
double b) |
static int |
compare(int a,
int b) |
static double |
cos(double d) |
static int |
floor_double(double d) |
static double |
interpolate(double a,
double b,
double d) |
static float |
interpolate(float a,
float b,
float d) |
static double |
retreatExp(double a,
double b,
double c,
double ratio,
double kick) |
static int |
retreatExpI(int a,
int b,
int c,
double ratio,
int kick) |
static int |
roundAway(double d) |
static double |
sin(double d) |
public static final double phi
public static final double pi
public static final double todeg
public static final double torad
public static final double sqrt2
public static double[] SIN_TABLE
public static double sin(double d)
public static double cos(double d)
public static float approachLinear(float a,
float b,
float max)
a - The valueb - The value to approachmax - The maximum steppublic static double approachLinear(double a,
double b,
double max)
a - The valueb - The value to approachmax - The maximum steppublic static float interpolate(float a,
float b,
float d)
a - The first valueb - The second valued - The interpolation factor, between 0 and 1public static double interpolate(double a,
double b,
double d)
a - The first valueb - The second valued - The interpolation factor, between 0 and 1public static double approachExp(double a,
double b,
double ratio)
a - The valueb - The value to approachratio - The ratio to reduce the difference bypublic static double approachExp(double a,
double b,
double ratio,
double cap)
a - The valueb - The value to approachratio - The ratio to reduce the difference bycap - The maximum amount to advance bypublic static double retreatExp(double a,
double b,
double c,
double ratio,
double kick)
a - The valueb - The value to approachratio - The ratio to reduce the difference byc - The value to retreat fromkick - The difference when a == cpublic static double clip(double value,
double min,
double max)
value - The valuemin - The min valuemax - The max valuepublic static boolean between(double a,
double x,
double b)
public static int approachExpI(int a,
int b,
double ratio)
public static int retreatExpI(int a,
int b,
int c,
double ratio,
int kick)
public static int floor_double(double d)
public static int roundAway(double d)
public static int compare(int a,
int b)
public static int compare(double a,
double b)