public class MathUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
(package private) static double |
epsilon |
(package private) static double |
twopi |
(package private) static double |
twopi_inv |
Constructor and Description |
---|
MathUtil() |
Modifier and Type | Method and Description |
---|---|
protected static double |
atan_mag1(double x) |
static double |
atan(double x)
returns [-PI/2, PI/2]
accurate within 0.014 degrees
|
static double |
atan2(double y,
double x) |
static void |
benchatan() |
static void |
benchexp() |
static double |
clamp(double v,
double min,
double max) |
static int |
clamp(int v,
int min,
int max) |
static boolean |
doubleEquals(double a,
double b)
Returns true if the two doubles are within a small epsilon of
each other.
|
protected static double |
exp_pos(double xin)
Quickly compute e^x for positive x.
|
static double |
exp(double xin)
Quickly compute e^x for all x.
|
static void |
inverse22(Matrix A) |
static void |
inverse33(Matrix A) |
static void |
main(java.lang.String[] args) |
static double |
mod2pi(double vin)
Ensure that v is [-PI, PI]
|
static double |
mod2pi(double ref,
double v)
Returns a value of v wrapped such that ref and v differ by no
more +/-PI
|
static int |
sign(double v) |
static double |
square(double x) |
static double epsilon
static double twopi_inv
static double twopi
public static double mod2pi(double vin)
public static double mod2pi(double ref, double v)
public static boolean doubleEquals(double a, double b)
public static int clamp(int v, int min, int max)
public static double clamp(double v, double min, double max)
public static final double square(double x)
public static final int sign(double v)
public static final double exp(double xin)
protected static final double exp_pos(double xin)
public static final double atan2(double y, double x)
public static final double atan(double x)
protected static final double atan_mag1(double x)
public static void main(java.lang.String[] args)
public static void benchexp()
public static void benchatan()
public static void inverse22(Matrix A)
public static void inverse33(Matrix A)