Package db2000.J.eXtrafunctions
Class fMATH
- java.lang.Object
-
- db2000.J.eXtrafunctions.fMATH
-
public class fMATH extends Object
math functions
-
-
Field Summary
Fields Modifier and Type Field Description static doublePIPI constant
-
Constructor Summary
Constructors Constructor Description fMATH()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static doubleAbs(double xValue)returns the absolute value of a numeric valuestatic doubleAcos(double xValue)returns the arc cosine of a numeric valuestatic doubleAcosh(double xValue)returns the area hyperboliccosine of a numeric valuestatic doubleAcot(double t)returns the arccotangent of a numeric valuestatic doubleAcoth(double xValue)returns the area hyperboliccotangent of a numeric valuestatic doubleAcsc(double xValue)returns the cosecantarc of the a number value (Y)static doubleAcsch(double xValue)returns the area hyperboliccosecant of a numeric valuestatic doubleAsec(double x)returns the arcsecant of a numeric value (X)static doubleAsech(double xValue)returns the area hyperbolicsecant of a numeric valuestatic doubleAsin(double xValue)returns the arcsine of a numeric valuestatic doubleAsinh(double xValue)returns the area hyperbolicsine of a numeric valuestatic doubleAtan(double xValue)returns the arctangent of a numeric valuestatic doubleAtan2(double Y, double X)returns the arctangent of the cartesian coordinate valuesstatic doubleAtanh(double xValue)returns the area hyperbolictangent of a numeric valuestatic doubleCos(double xValue)returns the cosine of an anglestatic doubleCosh(double xValue)returns the hyperboliccosine of a numeric valuestatic doubleCota(double xValue)returns the cotangent of a numeric valuestatic doubleCoth(double xValue)returns the hyperboliccotangent of a numeric valuestatic doubleCsch(double xValue)returns the hyperboliccosecant of a numeric valuestatic doubleCscs(double xValue)returns the cosecans of a numeric valuestatic doubleEval(String xArithmeticExpression)returns the results of an arithmetic expressionstatic double[]Eval2(String[] xArithmeticExpressions)returns the results of an arithmetic expression arraystatic doubleExp(double xValue)returns the base of natural logarithms raised to a power (e)static doubleFactorial(long xNumber, int xMode)returns the factorial for the numeric value (xMode = 0 or 1)static doubleFix(double xValue)returns the integer part of a numberstatic doubleGeoDistance(double xLatitude1, double xLongitude1, double xLatitude2, double xLongitude2, int xMeasureUnit, int xAlgorithmType)returns the distance between two points identified by geographic coordinatesstatic booleanIsPrime(long xNumber)returns [true] if the value if it is a prime number, otherwise [false]static doubleLog(double xValue)returns the natural logarithm of a numeric valuestatic longMCD(long x, long y)returns the greatest common divisor relative to two numeric valuesstatic longMCM(long x, long y)returns the least common multiple relative to two numeric valuesstatic doubleMod(double xValue1, double xValue2)returns returns the remainder of a divisionstatic doubleRnd()returns a random double value with a positive signstatic doubleRnd2(double xValue)returns a random double value with a positive signstatic doubleRound(double xValue)returns a number roundedstatic doubleRound2(double xValue, int xDigitsAfterDecimal)returns a number rounded to decimals specifiedstatic doubleSec(double xValue)returns the secant of a numeric valuestatic doubleSech(double xValue)returns the hyperbolicsecant of a numeric valuestatic intSgn(double xValue)checks the sign of a numeric valuestatic intShLint(int xValue, int xShift)shifts the bits of value shift-bits to the leftstatic longShLlng(long xValue, int xShift)shifts the bits of value shift-bits to the leftstatic intShRint(int xValue, int xShift)shifts the bits of value shift-bits to the right and keeps the MSBstatic longShRlng(long xValue, int xShift)shifts the bits of value shift-bits to the right and keeps the MSBstatic intShRZint(int xValue, int xShift)shifts the bits of value shift-bits to the right and shifts also the MSBstatic longShRZlng(long xValue, int xShift)shifts the bits of value shift-bits to the right and shifts also the MSBstatic doubleSin(double xValue)returns the sine of an anglestatic doubleSinC(double xValue)returns the sine cardinale of a numeric valuestatic doubleSinh(double xValue)returns the hyperbolicsine of a numeric valuestatic doubleSqr(double xValue)returns the square root of a numeric valuestatic doubleTan(double xValue)returns the tangent of an anglestatic doubleTanh(double xValue)returns the hyperbolictangent of a numeric value
-
-
-
Method Detail
-
Abs
public static double Abs(double xValue)
returns the absolute value of a numeric value- Parameters:
xValue- the numeric expression
-
Acos
public static double Acos(double xValue)
returns the arc cosine of a numeric value- Parameters:
xValue- the numeric expression
-
Acosh
public static double Acosh(double xValue)
returns the area hyperboliccosine of a numeric value- Parameters:
xValue- the numeric expression
-
Acot
public static double Acot(double t)
returns the arccotangent of a numeric value- Parameters:
xValue- the numeric expression
-
Acoth
public static double Acoth(double xValue)
returns the area hyperboliccotangent of a numeric value- Parameters:
xValue- the numeric expression
-
Acsc
public static double Acsc(double xValue)
returns the cosecantarc of the a number value (Y)- Parameters:
xValue- the numeric expression
-
Acsch
public static double Acsch(double xValue)
returns the area hyperboliccosecant of a numeric value- Parameters:
xValue- the numeric expression
-
Asec
public static double Asec(double x)
returns the arcsecant of a numeric value (X)- Parameters:
xValue- the numeric expression
-
Asech
public static double Asech(double xValue)
returns the area hyperbolicsecant of a numeric value- Parameters:
xValue- the numeric expression
-
Asin
public static double Asin(double xValue)
returns the arcsine of a numeric value- Parameters:
xValue- the numeric expression
-
Asinh
public static double Asinh(double xValue)
returns the area hyperbolicsine of a numeric value- Parameters:
xValue- the numeric expression
-
Atan
public static double Atan(double xValue)
returns the arctangent of a numeric value- Parameters:
xValue- the numeric expression
-
Atan2
public static double Atan2(double Y, double X)returns the arctangent of the cartesian coordinate values- Parameters:
X- the cartesian coordinate xY- the cartesian coordinate y
-
Atanh
public static double Atanh(double xValue)
returns the area hyperbolictangent of a numeric value- Parameters:
xValue- the numeric expression
-
Cos
public static double Cos(double xValue)
returns the cosine of an angle- Parameters:
xValue- the value that expresses an angle in radian
-
Cosh
public static double Cosh(double xValue)
returns the hyperboliccosine of a numeric value- Parameters:
xValue- the numeric expression
-
Cota
public static double Cota(double xValue)
returns the cotangent of a numeric value- Parameters:
xValue- the numeric expression
-
Coth
public static double Coth(double xValue)
returns the hyperboliccotangent of a numeric value- Parameters:
xValue- the numeric expression
-
Csch
public static double Csch(double xValue)
returns the hyperboliccosecant of a numeric value- Parameters:
xValue- the numeric expression
-
Cscs
public static double Cscs(double xValue)
returns the cosecans of a numeric value- Parameters:
xValue- the numeric expression
-
Eval
public static double Eval(String xArithmeticExpression)
returns the results of an arithmetic expression- Parameters:
xArithmeticExpression- the arithmetic expression xArithmeticExpressions (ae) example: ae = "(4*5(3-1)(67+23(25!)(5*6.5%2.2)))" or ae = "3+(4*5/3(2)(4)+45-1)" or ae = "(89*5/3(2(4(3(2))))(4)+57-1)"...
-
Eval2
public static double[] Eval2(String[] xArithmeticExpressions)
returns the results of an arithmetic expression array- Parameters:
xArithmeticExpressions- () the arithmetic expression ArithmeticExpressions (ae[]) examples: ae(0) = "(4*5(3-1)(67+23(25!)(5*6.5%2.2)))" and ae(1) = "3+(4*5/3(2)(4)+45-1)" and ae(2) = "(89*5/3(2(4(3(2))))(4)+57-1)"...
-
Exp
public static double Exp(double xValue)
returns the base of natural logarithms raised to a power (e)- Parameters:
xValue- the numeric expression
-
Factorial
public static double Factorial(long xNumber, int xMode)returns the factorial for the numeric value (xMode = 0 or 1)
-
Fix
public static double Fix(double xValue)
returns the integer part of a number- Parameters:
xValue- the number in input
-
GeoDistance
public static double GeoDistance(double xLatitude1, double xLongitude1, double xLatitude2, double xLongitude2, int xMeasureUnit, int xAlgorithmType)returns the distance between two points identified by geographic coordinates- Parameters:
xLatitude1- the latitude of point 1xLongitude1- the longitude of point 1xLatitude2- the latitude of point 2xLongitude2- the longitude of point 2xMeasureUnit- the unit measure (0 = Km, 1 = Miles)xAlgorithmType- the type of algorithm used for the distance calculation (1 = haversine, 2 = spherical law of cosines, 3 = spherical earth projection)
-
IsPrime
public static boolean IsPrime(long xNumber)
returns [true] if the value if it is a prime number, otherwise [false]
-
Log
public static double Log(double xValue)
returns the natural logarithm of a numeric value- Parameters:
xValue- the numeric expression
-
MCD
public static long MCD(long x, long y)returns the greatest common divisor relative to two numeric values
-
MCM
public static long MCM(long x, long y)returns the least common multiple relative to two numeric values
-
Mod
public static double Mod(double xValue1, double xValue2)returns returns the remainder of a division- Parameters:
xValue1- the number value to be dividedxValue2- the number value of the divisor
-
Rnd
public static double Rnd()
returns a random double value with a positive sign
-
Rnd2
public static double Rnd2(double xValue)
returns a random double value with a positive sign- Parameters:
xValue- the numeric value that represents the "base"
-
Round
public static double Round(double xValue)
returns a number rounded- Parameters:
xValue- the numeric expression being rounded
-
Round2
public static double Round2(double xValue, int xDigitsAfterDecimal)returns a number rounded to decimals specified- Parameters:
xValue- the numeric expression being roundedxDigitsAfterDecimal- the digits to the right of the decimal are included in the rounding
-
Sec
public static double Sec(double xValue)
returns the secant of a numeric value- Parameters:
xValue- the numeric expression
-
Sech
public static double Sech(double xValue)
returns the hyperbolicsecant of a numeric value- Parameters:
xValue- the numeric expression
-
Sgn
public static int Sgn(double xValue)
checks the sign of a numeric value- Parameters:
xValue- the numeric expression returns -1 = less than zero (negative sign), 0 = equal to zero, 1 = greater than zero (positive sign)
-
ShLint
public static int ShLint(int xValue, int xShift)shifts the bits of value shift-bits to the left- Parameters:
xValue- the value to be shiftedxShift- the amount of bits to shift the bits of value
-
ShLlng
public static long ShLlng(long xValue, int xShift)shifts the bits of value shift-bits to the left- Parameters:
xValue- the value to be shiftedxShift- the amount of bits to shift the bits of value
-
ShRint
public static int ShRint(int xValue, int xShift)shifts the bits of value shift-bits to the right and keeps the MSB- Parameters:
xValue- the value to be shiftedxShift- the amount of bits to shift the bits of value
-
ShRlng
public static long ShRlng(long xValue, int xShift)shifts the bits of value shift-bits to the right and keeps the MSB- Parameters:
xValue- the value to be shiftedxShift- the amount of bits to shift the bits of value
-
ShRZint
public static int ShRZint(int xValue, int xShift)shifts the bits of value shift-bits to the right and shifts also the MSB- Parameters:
xValue- the value to be shiftedxShift- the amount of bits to shift the bits of value
-
ShRZlng
public static long ShRZlng(long xValue, int xShift)shifts the bits of value shift-bits to the right and shifts also the MSB- Parameters:
xValue- the value to be shiftedxShift- the amount of bits to shift the bits of value
-
Sin
public static double Sin(double xValue)
returns the sine of an angle- Parameters:
xValue- the value that expresses an angle in radian
-
SinC
public static double SinC(double xValue)
returns the sine cardinale of a numeric value- Parameters:
xValue- the numeric expression
-
Sinh
public static double Sinh(double xValue)
returns the hyperbolicsine of a numeric value- Parameters:
xValue- the numeric expression
-
Sqr
public static double Sqr(double xValue)
returns the square root of a numeric value- Parameters:
xValue- the numeric expression
-
Tan
public static double Tan(double xValue)
returns the tangent of an angle- Parameters:
xValue- the numeric expression that expresses an angle in radians
-
Tanh
public static double Tanh(double xValue)
returns the hyperbolictangent of a numeric value- Parameters:
xValue- the numeric expression
-
-