Constructor and Description |
---|
Math2() |
Modifier and Type | Method and Description |
---|---|
static double |
bind(double min,
double value,
double max) |
static double |
div(double a,
double b,
double c)
performs a division a/b with a fallback if a/b would result in a division by zero.
|
static double |
gauss(double x,
double sigma)
calculate the gaussian derivation with mu = 0
|
static double |
gauss(double x,
double y,
double sigma)
calculate the gaussian derivation in 2d
|
static double[] |
getGauss(int size)
return a normalized gaussian kernel for the specified array size
|
static boolean |
isIn(double min,
double v,
double max) |
static boolean |
isIn(int min,
int v,
int max) |
static double |
pow(double a,
double b)
Method that wraps
Math.pow(double, double) and linearizes the calculation of the exponent up to power=64
which was faster on my machine in all tests. |
static Point2D |
rotate(int x,
int y,
double deg)
Rotate a point around the origin
|
static void |
toKarthesian(Point2D p)
Transforms the given point from polar to Karthesian coordinates.
|
static void |
toPolar(Point2D p)
Transforms the given point from karthesian to polar coordinates.
|
public static double div(double a, double b, double c)
a
- b
- c
- fallback if b = 0public static Point2D rotate(int x, int y, double deg)
x
- y
- deg
- in degreespublic static double gauss(double x, double y, double sigma)
x
- y
- sigma
- public static double gauss(double x, double sigma)
x
- sigma
- public static double[] getGauss(int size)
size
- public static double bind(double min, double value, double max)
min
- value
- max
- public static boolean isIn(int min, int v, int max)
min
- v
- max
- public static boolean isIn(double min, double v, double max)
min
- v
- max
- public static void toPolar(Point2D p)
p
- public static void toKarthesian(Point2D p)
p
- public static double pow(double a, double b)
Math.pow(double, double)
and linearizes the calculation of the exponent up to power=64
which was faster on my machine in all tests.a
- b
- Copyright © 2012. All Rights Reserved.