Class Complex

  • public class Complexextends Object
    A complex number, with a real and an imaginary part. (Possibley to be replaced with a class that has better support for complex arithmetic and functions of a complex variable.)
    • Field Detail

      • ZERO_C

        public static final Complex ZERO_C
      • ONE_C

        public static final Complex ONE_C
      • I_C

        public static final Complex I_C
      • re

        public double re
      • im

        public double im
    • Constructor Detail

      • Complex

        public Complex()
        Create a complex number initially equal to zero
      • Complex

        public Complex(double x)
        Create a complex number initially equal to the real number x.
      • Complex

        public Complex(double x,       double y)
        Create a complex number initially equal to x + iy
      • Complex

        public Complex(Complex c)
        Create a new complex number that is initially equal to a given complex number.
        c - The complex number to be copied. If null, it is treated as zero.
    • Method Detail

      • equals

        public boolean equals(Object obj)
        Returns true if obj is equal to this complex number. If obj is null or is not of type Complex, the return value is false.
        equals in class Object
      • conj

        public Complex conj()
        Computes the conjugate of a complex number.
      • polar

        public static Complex polar(double r,            double theta)
        Returns the complex number (r*cos(theta)) + i*(r*sin(theta)).
      • plus

        public Complex plus(Complex c)
        Returns this + c; c must be non-null.
      • minus

        public Complex minus(Complex c)
        Returns this - c; c must be non-null.
      • times

        public Complex times(Complex c)
        Returns this * c; c must be non-null.
      • dividedBy

        public Complex dividedBy(Complex c)
        Returns this / c; c must be non-null.
      • times

        public Complex times(double x)
      • plus

        public Complex plus(double x)
      • minus

        public Complex minus(double x)
      • dividedBy

        public Complex dividedBy(double x)
      • realLinComb

        public Complex realLinComb(double a,                  double b,                  Complex c)
        z.realLinComb(a,b,c) returns a*z+b*c, double a,b;
      • dot

        public double dot(Complex c) returns the scalar product* +*
      • abs2

        public double abs2()
        Returns the absolute value squared of this.
        real part squared plus imaginary part squared
      • r

        public double r()
        Returns the absolute value, "r" in polar coordinates, of this.
        the square root of (real part squared plus imaginary part squared)
      • theta

        public double theta()
        Returns arg(this), the angular polar coordinate of this complex number, in the range -pi to pi. The return value is simply Math.atan2(imaginary part, real part).
      • exponential

        public Complex exponential()
        Computes the complex exponential function, e^z, where z is this complex number.
      • inverse

        public Complex inverse()
        Computes the complex reciprocal function, 1/z, where z is this complex number.
      • logNearer

        public Complex logNearer(Complex previous)
        Computes that complex logarithm of this complex number that is nearest to previous. A test code is in fractals.TestAnalyticContinuation.
      • sinh

        public double sinh(double x)
      • cosh

        public double cosh(double x)
      • power

        public Complex power(double x)
      • integerPower

        public Complex integerPower(int k)
        Returns new Complex(this^k), for |k|< 9 using multiplication, for larger |k| using exp(k*log(this))
      • integerRoot

        public Complex integerRoot(int k)
        Returns a complex k-th root of this complex number. The root that is returned is the one with the smallest positive arg. (If k is 0, the return value is 1. If k is negative, the value is 1/integerRoot(-k).)
      • squareRootNearer

        public Complex squareRootNearer(Complex previous)
        Computes that square root of this complex number that is nearer to previous than to minus previous. A test code is in fractals.TestAnalyticContinuation.
      • mobius1_1

        public Complex mobius1_1(double r)
        The Moebius transformation ((1+r)z + r)/(rz + 1+r) has +1,-1 as fixed points. It maps the real line and the unit circle to itsself
      • stereographicProjection

        public double[] stereographicProjection()
      • assign

        public void assign(double x,          double y)
      • toString

        public String toString()
        Returns a string representation of the form a, i, -i, i*b, -i*b, a + i, a - i, a + i*b, or a - i*b. (Except when the real or imaginary part is undefined or infinite, the form is "(re) + i*(im)" where NaN, +INF, and -INF are used to indicate undefined and infinite values.)
        toString in class Object
      • assign

        public void assign(Complex c)
      • assignTimes

        public void assignTimes(double d)
      • assignInvert

        public void assignInvert()
      • assignPow

        public void assignPow(Complex z,             double x)
      • assignPlus

        public void assignPlus(Complex c)
      • assignMinus

        public void assignMinus(Complex c)
      • assignTimes

        public void assignTimes(Complex c,               double d)
      • assignTimes

        public void assignTimes(Complex c)
      • assignDivide

        public void assignDivide(Complex c)
      • assignTimesTimes

        public void assignTimesTimes(Complex a,                    double d)
      • assign_PlusTimes

        public void assign_PlusTimes(Complex a,                    Complex b)
      • assign_PlusTimes

        public void assign_PlusTimes(Complex a,                    double d)
      • assignTimes_PlusTimes

        public void assignTimes_PlusTimes(Complex a,                         Complex b,                         double d)

SCaVis 2.2 © jWork.ORG