Class BigComplexMath


  • public class BigComplexMath
    extends java.lang.Object
    Provides advanced functions operating on BigComplexs.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.math.BigDecimal TWO  
    • Constructor Summary

      Constructors 
      Constructor Description
      BigComplexMath()  
    • Field Detail

      • TWO

        private static final java.math.BigDecimal TWO
    • Constructor Detail

      • BigComplexMath

        public BigComplexMath()
    • Method Detail

      • reciprocal

        public static BigComplex reciprocal​(BigComplex x,
                                            java.math.MathContext mathContext)
        Calculates the reciprocal of the given complex number using the specified MathContext.
        Parameters:
        x - the complex number to calculate the reciprocal
        mathContext - the MathContext used to calculate the result
        Returns:
        the calculated BigComplex result
        See Also:
        BigComplex.reciprocal(MathContext)
      • conjugate

        public static BigComplex conjugate​(BigComplex x)
        Calculates the conjugate of the given complex number using the specified MathContext.
        Parameters:
        x - the complex number to calculate the conjugate
        Returns:
        the calculated BigComplex result
        See Also:
        BigComplex.conjugate()
      • abs

        public static java.math.BigDecimal abs​(BigComplex x,
                                               java.math.MathContext mathContext)
        Calculates the absolute value (also known as magnitude, length or radius) of the given complex number using the specified MathContext.
        Parameters:
        x - the complex number to calculate the absolute value
        mathContext - the MathContext used to calculate the result
        Returns:
        the calculated BigComplex result
        See Also:
        BigComplex.abs(MathContext)
      • absSquare

        public static java.math.BigDecimal absSquare​(BigComplex x,
                                                     java.math.MathContext mathContext)
        Calculates the square of the absolute value (also known as magnitude, length or radius) of the given complex number using the specified MathContext.
        Parameters:
        x - the complex number to calculate the square of the absolute value
        mathContext - the MathContext used to calculate the result
        Returns:
        the calculated BigComplex result
        See Also:
        BigComplex.absSquare(MathContext)
      • angle

        public static java.math.BigDecimal angle​(BigComplex x,
                                                 java.math.MathContext mathContext)
        Calculates the angle in radians of the given complex number using the specified MathContext.
        Parameters:
        x - the complex number to calculate the angle
        mathContext - the MathContext used to calculate the result
        Returns:
        the calculated BigComplex angle in radians
        See Also:
        BigComplex.angle(MathContext)
      • cos

        public static BigComplex cos​(BigComplex x,
                                     java.math.MathContext mathContext)
        Calculates the cosine (cosinus) of BigComplex x in the complex domain.
        Parameters:
        x - the BigComplex to calculate the cosine for
        mathContext - the MathContext used for the result
        Returns:
        the calculated cosine BigComplex with the precision specified in the mathContext
      • tan

        public static BigComplex tan​(BigComplex x,
                                     java.math.MathContext mathContext)
        Calculates the tangens of BigComplex x in the complex domain.
        Parameters:
        x - the BigComplex to calculate the tangens for
        mathContext - the MathContext used for the result
        Returns:
        the calculated tangens BigComplex with the precision specified in the mathContext
      • log

        public static BigComplex log​(BigComplex x,
                                     java.math.MathContext mathContext)
        Calculates the natural logarithm of BigComplex x in the complex domain.

        See: Wikipedia: Complex logarithm

        Parameters:
        x - the BigComplex to calculate the natural logarithm for
        mathContext - the MathContext used for the result
        Returns:
        the calculated natural logarithm BigComplex with the precision specified in the mathContext
      • pow

        public static BigComplex pow​(BigComplex x,
                                     long y,
                                     java.math.MathContext mathContext)
        Calculates BigComplex x to the power of long y (xy).

        The implementation tries to minimize the number of multiplications of x (using squares whenever possible).

        See: Wikipedia: Exponentiation - efficient computation

        Parameters:
        x - the BigComplex value to take to the power
        y - the long value to serve as exponent
        mathContext - the MathContext used for the result
        Returns:
        the calculated x to the power of y with the precision specified in the mathContext
      • pow

        public static BigComplex pow​(BigComplex x,
                                     java.math.BigDecimal y,
                                     java.math.MathContext mathContext)
        Calculates BigComplex x to the power of BigDecimal y (xy).
        Parameters:
        x - the BigComplex value to take to the power
        y - the BigDecimal value to serve as exponent
        mathContext - the MathContext used for the result
        Returns:
        the calculated x to the power of y with the precision specified in the mathContext
      • pow

        public static BigComplex pow​(BigComplex x,
                                     BigComplex y,
                                     java.math.MathContext mathContext)
        Calculates BigComplex x to the power of BigComplex y (xy).
        Parameters:
        x - the BigComplex value to take to the power
        y - the BigComplex value to serve as exponent
        mathContext - the MathContext used for the result
        Returns:
        the calculated x to the power of y with the precision specified in the mathContext
      • root

        public static BigComplex root​(BigComplex x,
                                      java.math.BigDecimal n,
                                      java.math.MathContext mathContext)
        Calculates the BigDecimal n'th root of BigComplex x (n√x).

        See Wikipedia: Square root

        Parameters:
        x - the BigComplex value to calculate the n'th root
        n - the BigDecimal defining the root
        mathContext - the MathContext used for the result
        Returns:
        the calculated n'th root of x with the precision specified in the mathContext