public class Mathematics extends Object
Modifier and Type | Field and Description |
---|---|
static double |
BPS_TO_KBPS |
static double |
DEFAULT_DELOG |
static double |
DEFAULT_LOG_START_RANGE |
static double |
DEGRAD |
static int |
KM_TO_METERS |
static double |
MHZ_TO_HZ |
static int |
PID |
static double |
RADEG |
static double |
SQRT3 |
Constructor and Description |
---|
Mathematics() |
Modifier and Type | Method and Description |
---|---|
static double |
acosD(double angle)
Returns the arc cosine of an angle, in the range of 0.0 through pi.
|
static double |
angle(double x1,
double y1,
double x2,
double y2)
Finds the angle between two points
|
static double |
asinD(double x)
Returns the arc sine of an angle, in the range of -pi/2 through pi/2.
|
static double |
atan2D(double x,
double y)
Converts rectangular coordinates (x, y) to polar (r, theta).
|
static double |
atanD(double angle)
Returns the arc tangent of an angle, in the range of -pi/2 through pi/2.
|
static double |
calculateAvgPercentage(VectorResultType vector1,
VectorResultType vector2) |
static double |
calculateCorrelation(double[] a,
double[] b)
Pearson Correlation
|
static double |
calculateElevation(AntennaResult from,
AntennaResult to) |
static double |
calculateElevation(Point2D from,
double fromHeight,
Point2D to,
double toHeight)
Calculate the elevation angle between points.
|
static double |
calculateKartesianAngle(Point2D to)
Calculate the Kartesian angle between (0,0) and point.
|
static double |
calculateKartesianAngle(Point2D to,
Point2D from)
Calculate the Kartesian angle between points.
|
static double |
convertAngleToConfineToHorizontalDefinedRange(double angle)
Generic conversion of the horizontal angle so that it remains within the [0,360] range definition
|
static double |
convertAngleToConfineToVerticalDefinedRange(double angle)
Generic conversion of the vertical angle so that it remains within the [-90,+90] range definition
|
static double |
cosD(double angle)
Returns the trigonometric cosine of an angle
|
static double |
cosh(double x)
Hyberbolic Cosine function
|
static double |
dB2Linear(double value) |
static double |
distance(Point2D to)
Calculates the distance from (0,0) to the given point
|
static double |
distance(Point2D from,
Point2D to)
Calculates the distance between two points
|
static boolean |
equals(double a,
double b,
double tolerance) |
static double |
fromdBm2Watt(double dbm) |
static double |
fromWatt2dBm(double watt) |
static double |
getAverage(double[] p)
Return average value of an array of
double values. |
static double |
getAverage(double[] p,
double minValue,
double maxValue)
Return average value of an array of
double values, for
length length of array. |
static double |
getAverage(double[] p,
int length,
boolean ignoreZeros)
Return average value of an array of
double values, for
length length of array. |
static double |
getAverage(double[] p,
int length,
double minValue,
double maxValue,
boolean ignoreZeros)
Return average value of an array of
double values, for
length length of array. |
static double |
getMedian(double[] p,
int length,
boolean ignoreZeros) |
static double |
getMinimumLogDomainValue(double minimumDistribution,
double minRange)
Get the smallest number that can be used a range start for the logarithmic
graphs
|
static double |
getStdDev(double[] p)
Return Standard Deviation of array
|
static double |
getStdDev(double[] p,
double ave)
Return Standard Deviation of array with given average.
|
static double |
getStdDev(double[] p,
double ave,
int length)
Return Standard Deviation of array with given average and length
|
static double |
getStdDev(double[] p,
double ave,
int length,
boolean ignoreZeros)
Return Standard Deviation of array with given average and length
|
static double |
getStdDev(double[] p,
double ave,
int length,
double minValue,
double maxValue)
Return Standard Deviation of array with given average and length
|
static double |
getStdDev(double[] p,
double ave,
int length,
double minValue,
double maxValue,
boolean ignoreZeros)
Return Standard Deviation of array with given average and length
|
static double |
linear2dB(double value) |
static double |
linearInterpolate(double wantedX,
Point2D first,
Point2D second)
Does a linear interpolation of points first and second to calculate
the wanted function value of wantedX
|
static double |
max(double[] p)
Return maximum value of double array
|
static double |
max(double[] p,
double minValue,
double maxValue)
Return maximum value of double array
|
static double |
min(double[] p)
Return minimum value of double array
|
static double |
min(double[] p,
double minValue,
double maxValue)
Return minimum value of double array
|
static double |
powerSubtract(double value,
double sub) |
static double |
powerSummation(double... powers) |
static double |
Qi(double x) |
static double |
round(double d)
Rounds a double to 3 digits
|
static double |
sinD(double angle)
Returns the trigonometric sine of an angle
|
static double |
sinh(double x)
Hyberbolic Sine function
|
static <T> T[] |
sortBest(T[] elements) |
static double[] |
stripZeros(double[] array) |
static double |
tanD(double angle)
Returns the trigonometric tangent of an angle
|
static double |
tanh(double x)
Hyberbolic trigonometric tangent function
|
public static final int KM_TO_METERS
public static final double BPS_TO_KBPS
public static final double MHZ_TO_HZ
public static final double DEGRAD
public static final double RADEG
public static final double DEFAULT_DELOG
public static final double DEFAULT_LOG_START_RANGE
public static final double SQRT3
public static final int PID
public static double distance(Point2D from, Point2D to)
from
- from this pointto
- to this pointpublic static double distance(Point2D to)
to
- from zero to this pointpublic static double dB2Linear(double value)
public static double linear2dB(double value)
public static double fromdBm2Watt(double dbm)
public static double fromWatt2dBm(double watt)
public static double getMinimumLogDomainValue(double minimumDistribution, double minRange)
minimumDistribution
- the smallest distributionminRange
- the range minimumpublic static double powerSummation(double... powers)
public static double powerSubtract(double value, double sub)
public static double round(double d)
d
- public static double acosD(double angle)
angle
- given in degreespublic static double asinD(double x)
x
- angle given in degreespublic static double atan2D(double x, double y)
public static double angle(double x1, double y1, double x2, double y2)
public static double atanD(double angle)
angle
- given in degreespublic static double cosD(double angle)
angle
- in degreespublic static double cosh(double x)
x
- public static double getAverage(double[] p)
double
values.p
- Array of double valuespublic static double getAverage(double[] p, int length, boolean ignoreZeros)
double
values, for
length
length of array.p
- Array of double valueslength
- The number of array entries to average overlength
public static double getMedian(double[] p, int length, boolean ignoreZeros)
public static double[] stripZeros(double[] array)
public static double getAverage(double[] p, double minValue, double maxValue)
double
values, for
length
length of array.p
- Array of double valueslength
public static double getAverage(double[] p, int length, double minValue, double maxValue, boolean ignoreZeros)
double
values, for
length
length of array.p
- Array of double valueslength
- The number of array entries to average overlength
public static double getStdDev(double[] p)
p
- Array of double valuespublic static double getStdDev(double[] p, double ave)
p
- Array of double valuesave
- Average value of ppublic static double getStdDev(double[] p, double ave, int length, double minValue, double maxValue)
p
- Array of double valuesave
- Average value of plength
- The number of array which has been averaged overpublic static double getStdDev(double[] p, double ave, int length, double minValue, double maxValue, boolean ignoreZeros)
p
- Array of double valuesave
- Average value of plength
- The number of array which has been averaged overpublic static double getStdDev(double[] p, double ave, int length, boolean ignoreZeros)
p
- Array of double valuesave
- Average value of plength
- The number of array which has been averaged overpublic static double getStdDev(double[] p, double ave, int length)
p
- Array of double valuesave
- Average value of plength
- The number of array which has been averaged overpublic static double max(double[] p)
p
- Array of double valuespublic static double min(double[] p)
p
- Array of double valuespublic static double max(double[] p, double minValue, double maxValue)
p
- Array of double valuespublic static double min(double[] p, double minValue, double maxValue)
p
- Array of double valuespublic static double sinD(double angle)
angle
- in degreespublic static double sinh(double x)
x
- public static double tanD(double angle)
angle
- in degreespublic static double tanh(double x)
x
- public static double calculateCorrelation(double[] a, double[] b)
public static <T> T[] sortBest(T[] elements)
public static double linearInterpolate(double wantedX, Point2D first, Point2D second)
wantedX
- first
- second
- public static boolean equals(double a, double b, double tolerance)
public static double Qi(double x)
public static double calculateKartesianAngle(Point2D to, Point2D from)
to
- from
- public static double convertAngleToConfineToHorizontalDefinedRange(double angle)
angle
- any angle in degreepublic static double calculateKartesianAngle(Point2D to)
equivalent to: calculateKartesianAngle( Point2D to, 0)
See calculateKartesianAngle( Point2D to, Point2D from) for more details.
to
- public static double calculateElevation(Point2D from, double fromHeight, Point2D to, double toHeight)
the fundamental equation is as follow:
elevation = atanD((toHeight - fromHeight) / (distance * KM_TO_METERS))
from
- fromHeight
- to
- toHeight
- public static double calculateElevation(AntennaResult from, AntennaResult to)
public static double calculateAvgPercentage(VectorResultType vector1, VectorResultType vector2)
public static double convertAngleToConfineToVerticalDefinedRange(double angle)
angle
- any angle in degreeCopyright © 2018. All rights reserved.