Class BigComplexMath
BigComplex
s.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic BigDecimal
abs
(BigComplex x, MathContext mathContext) Calculates the absolute value (also known as magnitude, length or radius) of the given complex number using the specifiedMathContext
.static BigDecimal
absSquare
(BigComplex x, MathContext mathContext) Calculates the square of the absolute value (also known as magnitude, length or radius) of the given complex number using the specifiedMathContext
.static BigComplex
acos
(BigComplex x, MathContext mathContext) Calculates the arc cosine (inverted cosine) ofBigComplex
x in the complex domain.static BigComplex
acot
(BigComplex x, MathContext mathContext) Calculates the arc cotangens (inverted cotangens) ofBigComplex
x in the complex domain.static BigDecimal
angle
(BigComplex x, MathContext mathContext) Calculates the angle in radians of the given complex number using the specifiedMathContext
.static BigComplex
asin
(BigComplex x, MathContext mathContext) Calculates the arc sine (inverted sine) ofBigComplex
x in the complex domain.static BigComplex
atan
(BigComplex x, MathContext mathContext) Calculates the arc tangens (inverted tangens) ofBigComplex
x in the complex domain.static BigComplex
Calculates the conjugate of the given complex number using the specifiedMathContext
.static BigComplex
cos
(BigComplex x, MathContext mathContext) Calculates the cosine (cosinus) ofBigComplex
x in the complex domain.static BigComplex
exp
(BigComplex x, MathContext mathContext) Calculates the natural exponent ofBigComplex
x (ex) in the complex domain.static BigComplex
factorial
(BigComplex x, MathContext mathContext) Calculates the factorial of the specifiedBigComplex
.static BigComplex
gamma
(BigComplex x, MathContext mathContext) Calculates the gamma function of the specifiedBigComplex
.static BigComplex
log
(BigComplex x, MathContext mathContext) Calculates the natural logarithm ofBigComplex
x in the complex domain.static BigComplex
pow
(BigComplex x, long y, MathContext mathContext) CalculatesBigComplex
x to the power oflong
y (xy).static BigComplex
pow
(BigComplex x, BigComplex y, MathContext mathContext) CalculatesBigComplex
x to the power ofBigComplex
y (xy).static BigComplex
pow
(BigComplex x, BigDecimal y, MathContext mathContext) CalculatesBigComplex
x to the power ofBigDecimal
y (xy).static BigComplex
reciprocal
(BigComplex x, MathContext mathContext) Calculates the reciprocal of the given complex number using the specifiedMathContext
.static BigComplex
root
(BigComplex x, BigComplex n, MathContext mathContext) Calculates theBigComplex
n'th root ofBigComplex
x (n√x).static BigComplex
root
(BigComplex x, BigDecimal n, MathContext mathContext) Calculates theBigDecimal
n'th root ofBigComplex
x (n√x).static BigComplex
sin
(BigComplex x, MathContext mathContext) Calculates the sine (sinus) ofBigComplex
x in the complex domain.static BigComplex
sqrt
(BigComplex x, MathContext mathContext) Calculates the square root ofBigComplex
x in the complex domain (√x).static BigComplex
tan
(BigComplex x, MathContext mathContext) Calculates the tangens ofBigComplex
x in the complex domain.
-
Field Details
-
TWO
-
-
Constructor Details
-
BigComplexMath
public BigComplexMath()
-
-
Method Details
-
reciprocal
Calculates the reciprocal of the given complex number using the specifiedMathContext
.- Parameters:
x
- the complex number to calculate the reciprocalmathContext
- theMathContext
used to calculate the result- Returns:
- the calculated
BigComplex
result - See Also:
-
conjugate
Calculates the conjugate of the given complex number using the specifiedMathContext
.- Parameters:
x
- the complex number to calculate the conjugate- Returns:
- the calculated
BigComplex
result - See Also:
-
abs
Calculates the absolute value (also known as magnitude, length or radius) of the given complex number using the specifiedMathContext
.- Parameters:
x
- the complex number to calculate the absolute valuemathContext
- theMathContext
used to calculate the result- Returns:
- the calculated
BigComplex
result - See Also:
-
absSquare
Calculates the square of the absolute value (also known as magnitude, length or radius) of the given complex number using the specifiedMathContext
.- Parameters:
x
- the complex number to calculate the square of the absolute valuemathContext
- theMathContext
used to calculate the result- Returns:
- the calculated
BigComplex
result - See Also:
-
angle
Calculates the angle in radians of the given complex number using the specifiedMathContext
.- Parameters:
x
- the complex number to calculate the anglemathContext
- theMathContext
used to calculate the result- Returns:
- the calculated
BigComplex
angle in radians - See Also:
-
factorial
Calculates the factorial of the specifiedBigComplex
.This implementation uses Spouge's approximation to calculate the factorial for non-integer values.
This involves calculating a series of constants that depend on the desired precision. Since this constant calculation is quite expensive (especially for higher precisions), the constants for a specific precision will be cached and subsequent calls to this method with the same precision will be much faster.
It is therefore recommended to do one call to this method with the standard precision of your application during the startup phase and to avoid calling it with many different precisions.
See: Wikipedia: Factorial - Extension of factorial to non-integer values of argument
- Parameters:
x
- theBigComplex
mathContext
- theMathContext
used for the result- Returns:
- the factorial
BigComplex
- Throws:
ArithmeticException
- if x is a negative integer value (-1, -2, -3, ...)- See Also:
-
gamma
Calculates the gamma function of the specifiedBigComplex
.This implementation uses
factorial(BigComplex, MathContext)
internally, therefore the performance implications described there apply also for this method.- Parameters:
x
- theBigComplex
mathContext
- theMathContext
used for the result- Returns:
- the gamma
BigComplex
- Throws:
ArithmeticException
- if x-1 is a negative integer value (-1, -2, -3, ...)- See Also:
-
exp
Calculates the natural exponent ofBigComplex
x (ex) in the complex domain.- Parameters:
x
- theBigComplex
to calculate the exponent formathContext
- theMathContext
used for the result- Returns:
- the calculated exponent
BigComplex
with the precision specified in themathContext
-
sin
Calculates the sine (sinus) ofBigComplex
x in the complex domain.- Parameters:
x
- theBigComplex
to calculate the sine formathContext
- theMathContext
used for the result- Returns:
- the calculated sine
BigComplex
with the precision specified in themathContext
-
cos
Calculates the cosine (cosinus) ofBigComplex
x in the complex domain.- Parameters:
x
- theBigComplex
to calculate the cosine formathContext
- theMathContext
used for the result- Returns:
- the calculated cosine
BigComplex
with the precision specified in themathContext
-
tan
Calculates the tangens ofBigComplex
x in the complex domain.- Parameters:
x
- theBigComplex
to calculate the tangens formathContext
- theMathContext
used for the result- Returns:
- the calculated tangens
BigComplex
with the precision specified in themathContext
-
atan
Calculates the arc tangens (inverted tangens) ofBigComplex
x in the complex domain.See: Wikipedia: Inverse trigonometric functions (Extension to complex plane)
- Parameters:
x
- theBigComplex
to calculate the arc tangens formathContext
- theMathContext
used for the result- Returns:
- the calculated arc tangens
BigComplex
with the precision specified in themathContext
-
acot
Calculates the arc cotangens (inverted cotangens) ofBigComplex
x in the complex domain.See: Wikipedia: Inverse trigonometric functions (Extension to complex plane)
- Parameters:
x
- theBigComplex
to calculate the arc cotangens formathContext
- theMathContext
used for the result- Returns:
- the calculated arc cotangens
BigComplex
with the precision specified in themathContext
-
asin
Calculates the arc sine (inverted sine) ofBigComplex
x in the complex domain.See: Wikipedia: Inverse trigonometric functions (Extension to complex plane)
- Parameters:
x
- theBigComplex
to calculate the arc sine formathContext
- theMathContext
used for the result- Returns:
- the calculated arc sine
BigComplex
with the precision specified in themathContext
-
acos
Calculates the arc cosine (inverted cosine) ofBigComplex
x in the complex domain.See: Wikipedia: Inverse trigonometric functions (Extension to complex plane)
- Parameters:
x
- theBigComplex
to calculate the arc cosine formathContext
- theMathContext
used for the result- Returns:
- the calculated arc cosine
BigComplex
with the precision specified in themathContext
-
sqrt
Calculates the square root ofBigComplex
x in the complex domain (√x).See Wikipedia: Square root (Square root of an imaginary number)
- Parameters:
x
- theBigComplex
to calculate the square root formathContext
- theMathContext
used for the result- Returns:
- the calculated square root
BigComplex
with the precision specified in themathContext
-
log
Calculates the natural logarithm ofBigComplex
x in the complex domain.- Parameters:
x
- theBigComplex
to calculate the natural logarithm formathContext
- theMathContext
used for the result- Returns:
- the calculated natural logarithm
BigComplex
with the precision specified in themathContext
-
pow
CalculatesBigComplex
x to the power oflong
y (xy).The implementation tries to minimize the number of multiplications of
x
(using squares whenever possible).- Parameters:
x
- theBigComplex
value to take to the powery
- thelong
value to serve as exponentmathContext
- theMathContext
used for the result- Returns:
- the calculated x to the power of y with the precision specified in the
mathContext
-
pow
CalculatesBigComplex
x to the power ofBigDecimal
y (xy).- Parameters:
x
- theBigComplex
value to take to the powery
- theBigDecimal
value to serve as exponentmathContext
- theMathContext
used for the result- Returns:
- the calculated x to the power of y with the precision specified in the
mathContext
-
pow
CalculatesBigComplex
x to the power ofBigComplex
y (xy).- Parameters:
x
- theBigComplex
value to take to the powery
- theBigComplex
value to serve as exponentmathContext
- theMathContext
used for the result- Returns:
- the calculated x to the power of y with the precision specified in the
mathContext
-
root
- Parameters:
x
- theBigComplex
value to calculate the n'th rootn
- theBigDecimal
defining the rootmathContext
- theMathContext
used for the result- Returns:
- the calculated n'th root of x with the precision specified in the
mathContext
-
root
- Parameters:
x
- theBigComplex
value to calculate the n'th rootn
- theBigComplex
defining the rootmathContext
- theMathContext
used for the result- Returns:
- the calculated n'th root of x with the precision specified in the
mathContext
-