Catalano.Math
Class Approximation
- java.lang.Object
-
- Catalano.Math.Approximation
-
public final class Approximation extends java.lang.ObjectCalculate approximations for common math operations.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static intabs(int x)Calculate absolute number.static longabs(long x)Calculate absolute number.static doubleatan2(double y, double x)Returns the angle theta from the conversion of rectangular coordinates (x, y) to polar coordinates (r, theta).static doubleHighprecision_Exp(double x)Calculate Exp.static doubleHighprecision_Pow(double x, double y)Calculate Pow.static doubleHighprecision_Sin(double x)Calculate Sin using Quadratic curve.static doubleLowprecision_Log(double x)Calculate Pow.static doubleLowprecision_Pow(double x, double y)Calculate Pow.static doubleLowprecision_Sin(double x)Calculate Sin using Quadratic curve.
-
-
-
Method Detail
-
abs
public static int abs(int x)
Calculate absolute number.- Parameters:
x- Number.- Returns:
- Abs(x).
-
abs
public static long abs(long x)
Calculate absolute number.- Parameters:
x- Number.- Returns:
- Abs(x).
-
Highprecision_Pow
public static double Highprecision_Pow(double x, double y)Calculate Pow. The pow is calculate following the formula: Formula: Exp(y * Log(x))- Parameters:
x- The base.y- The exponent.- Returns:
-
Lowprecision_Pow
public static double Lowprecision_Pow(double x, double y)Calculate Pow. The pow is calculate following the formula: Formula: Highprecision_Exp(y * Log(x))- Parameters:
x- The base.y- The exponent.- Returns:
-
Highprecision_Exp
public static double Highprecision_Exp(double x)
Calculate Exp. Exp by Taylor series (9).- Parameters:
x- Value.- Returns:
- Exponential.
-
Lowprecision_Log
public static double Lowprecision_Log(double x)
Calculate Pow. The exp is calculate following the formula: 6*(x-1) / (x + 1 + 4*(Sqrt(x)));- Parameters:
x- Value.- Returns:
-
Lowprecision_Sin
public static double Lowprecision_Sin(double x)
Calculate Sin using Quadratic curve.- Parameters:
x- An angle, in radians.- Returns:
- Result.
-
Highprecision_Sin
public static double Highprecision_Sin(double x)
Calculate Sin using Quadratic curve.- Parameters:
x- An angle, in radians.- Returns:
- Result.
-
atan2
public static double atan2(double y, double x)Returns the angle theta from the conversion of rectangular coordinates (x, y) to polar coordinates (r, theta). This method computes the phase theta by computing an arc tangent of y/x in the range of -pi to pi.- Parameters:
y- Y axis coordinate.x- X axis coordinate.- Returns:
- The theta component of the point (r, theta) in polar coordinates that corresponds to the point (x, y) in Cartesian coordinates.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG