public final class MathHelper extends Object
Modifier and Type | Field and Description |
---|---|
static double |
PI_HALF |
Modifier | Constructor and Description |
---|---|
private |
MathHelper() |
Modifier and Type | Method and Description |
---|---|
static double |
acot(double value)
Return the
arcus cotangens of value in radian. |
static double |
angleDiff360(double angleOne,
double angleTwo) |
static double |
calcMean(double[] values)
Return the mean value of an array of double.
|
static double |
calcMedian(double[] values)
Returns the median value of an array of double.
|
static double[] |
calcMinMax(double[] values)
Returns the min and max value.
|
static double |
calcVariance(double[] values)
Returns the variance of an array of double.
|
static double |
cot(double value)
Return the
cotangens of value . |
static Point2D.Double |
point2DDiff(Point2D.Double pointOne,
Point2D.Double pointTwo)
Substract two
Point2D.Double . |
static Point2D.Double |
point2DSum(Point2D.Double pointOne,
Point2D.Double pointTwo)
Sums up two
Point2D.Double . |
static Point2D.Double |
toCartesianAsPoint2D(double angleDegree)
Converts an angle in degree to its corresponding in cartesian
coordinates.
|
static double[] |
toCartesianAsVector(double angleDegree)
Converts an angle in degree to its correspondant in cartesian
coordinates.
|
static double |
toPositiveAngle360(double angle)
Simple way to convert negative angles to 0-360 degree.
|
static double[] |
unitVector(double[] vector)
Return the unit vector of
vector . |
static double[] |
vectorDiff(double[] vecOne,
double[] vecTwo)
Subtract two vectors.
|
static double |
vectorNorm(double[] vector)
Returns the norm of a vector.
|
static double[] |
vectorSum(double[] vecOne,
double[] vecTwo)
Sums up two vectors.
|
public static final double PI_HALF
public static final double acot(double value)
arcus cotangens
of value
in radian.
This function is implemented as described in "Teubner - Taschenbuch der Mathematik [Bronstein/Samendjajew]".
value
- A rational floating point number.Arcuscotangens
of value
.public static final double angleDiff360(double angleOne, double angleTwo)
angleOne
- angleTwo
- public static double calcMean(double[] values)
values
- public static double calcMedian(double[] values)
values
- public static double[] calcMinMax(double[] values)
values
- public static double calcVariance(double[] values)
values
- public static final double cot(double value)
cotangens
of value
. In case of 0
the returned value is not a number
- the
tangens function is not defined for zero -> 1/Infinty is not
a number.
value
- The argument of the cotangens function.public static final Point2D.Double point2DDiff(Point2D.Double pointOne, Point2D.Double pointTwo)
Point2D.Double
.
pointOne
- pointTwo
- public static final Point2D.Double point2DSum(Point2D.Double pointOne, Point2D.Double pointTwo)
Point2D.Double
.
pointOne
- pointTwo
- public static final Point2D.Double toCartesianAsPoint2D(double angleDegree)
angleDegree
- An angle in degree.Point2D.Double
containing the coordinate in
cartesian coordinate systempublic static final double[] toCartesianAsVector(double angleDegree)
angleDegree
- An angle between 0 and 359 degree.x
and y
cartesian
coordinate.public static final double toPositiveAngle360(double angle)
angle
- An angle in the range of [-360,360]public static double[] vectorDiff(double[] vecOne, double[] vecTwo)
vecOne
- vecTwo
- public static double vectorNorm(double[] vector)
vector
- public static double[] unitVector(double[] vector)
vector
.
vector
- public static final double[] vectorSum(double[] vecOne, double[] vecTwo)
vecOne
- vecTwo
- Copyright © 2010–2020 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.