Class Complex
java.lang.Object | +----Complex
- public class Complex
- extends Object
- DOUBLEDIGITS
- The default number of digits to display in formatted coversion of Doubles to Strings.
- FOUR
- The complex constant 4.
- I
- The complex constant i.
- IDENTRESOL
- Powers of an elliptic generator whose (1,1) entry are at this distance squared or less are considered to be the identity, so enabling us to compute the order of that elliptic element.
- MAXELLIPORD
- An cutoff for the calculation of orders of elliptic elements.
- MAXPOWMAX
- The cutoff for calculated maxpows -- above this value we arbitrarily truncate down to this.
- MINUS_I
- The complex constant -i.
- MINUS_ONE
- The complex constant -1.
- ONE
- The complex constant 1.
- period
- A string containing one period for formatting Double.toString output to a certain number of decimal digits.
- TWO
- The complex constant 2.
- x
- The real part of this complex number.
- y
- The imaginary part of this complex number.
- ZERO
- The complex constant 0.
- Complex()
- Constructor for the complex number zero.
- Complex(Complex)
- Constructor for a complex number identical to one given as input.
- Complex(double, double)
- Constructor for an arbitrary complex number.
- add(Complex, Complex)
- Compute the sum of two complex numbers.
- argument()
- Compute this's argument.
- argument(Complex)
- Compute the argument of a complex number, in the range (-pi,pi].
- conj()
- Computes this's complex conjugate.
- conj(Complex)
- Computes the complex conjugate of the input complex number.
- distsq(Complex, Complex)
- Computes the square of the distance between two complex numbers.
- divide(Complex, Complex)
- Divides one input complex number by another.
- DoubleToString(double)
- The default invocation of DoubleToString has DOUBLEDIGITS of precision.
- DoubleToString(double, int)
- Converts a double to a string with a certain number of digits of precision.
- make_maxpow(Complex, Complex)
- Compute the maxpow corresponding to the current trace and previously calculated (1,1) entry.
- make_z11(Complex)
- Compute the (1,1) entry of the canonical matrix with given trace.
- modsq()
- Compute this's modulus squared.
- modsq(Complex)
- Compute the modulus squared of a complex number.
- modulus()
- Compute this's modulus.
- modulus(Complex)
- Computes the modulus of an input complex number.
- multiply(Complex, Complex)
- Multiplies one input complex number by another.
- sqrt(Complex)
- Computes the square root of an input complex number
- square(Complex)
- Squares an input complex number.
- stringToComplex(String)
- Convert an input string to a complex number.
- subtract(Complex, Complex)
- Compute the difference of two complex numbers.
- toString()
- Convert this complex number to a string, with the real and imaginary parts separated by a comma.
x
public double x
- The real part of this complex number.
public double y
- The imaginary part of this complex number.
public static final Complex ZERO
- The complex constant 0.
public static final Complex ONE
- The complex constant 1.
public static final Complex TWO
- The complex constant 2.
public static final Complex FOUR
- The complex constant 4.
public static final Complex MINUS_ONE
- The complex constant -1.
public static final Complex I
- The complex constant i.
public static final Complex MINUS_I
- The complex constant -i.
public static final int MAXPOWMAX
- The cutoff for calculated maxpows -- above this value we arbitrarily
truncate down to this. A good default is around 50; much more and
computations start to take way too long, much less and a reasonable
window on the trace plane includes lots of pixel for which we use the
artificial cutoff.
public static final int MAXELLIPORD
- An cutoff for the calculation of orders of elliptic elements. We only
try possible orders up to this value, then give up.
public static final double IDENTRESOL
- Powers of an elliptic generator whose (1,1) entry are at this distance
squared or less are considered to be the identity, so enabling us to
compute the order of that elliptic element.
public static final String period
- A string containing one period for formatting Double.toString
output to a certain number of decimal digits.
public static final int DOUBLEDIGITS
- The default number of digits to display in formatted coversion of
Doubles to Strings.
Complex
public Complex()
- Constructor for the complex number zero.
public Complex(double xx, double yy)
- Constructor for an arbitrary complex number.
- Parameters:
- xx - the real part
- yy - the imaginary part
public Complex(Complex z)
- Constructor for a complex number identical to one given as input.
- Parameters:
- z - the complex number to duplicate
add
public static Complex add(Complex a, Complex b)
- Compute the sum of two complex numbers.
- Parameters:
- a - one input complex number
- b - and another
- Returns:
- the sum
public static Complex subtract(Complex a, Complex b)
- Compute the difference of two complex numbers.
- Parameters:
- a - one input complex number
- b - and another
- Returns:
- the difference
public static Complex multiply(Complex a, Complex b)
- Multiplies one input complex number by another.
- Parameters:
- a - one input complex number
- b - and another
- Returns:
- the product
public static Complex divide(Complex a, Complex b)
- Divides one input complex number by another.
- Parameters:
- a - the numerator
- b - the denominator
- Returns:
- the ratio
public static Complex square(Complex z)
- Squares an input complex number.
- Parameters:
- z - the complex number to square
- Returns:
- its square
public static Complex sqrt(Complex z)
- Computes the square root of an input complex number
- Parameters:
- z - the number whose square root to compute
- Returns:
- s the square root
public static double argument(Complex z)
- Compute the argument of a complex number, in the range (-pi,pi].
- Parameters:
- z - the complex number to examine
- Returns:
- its argument
public double argument()
- Compute this's argument.
- Returns:
- this's argument
public static Complex conj(Complex z)
- Computes the complex conjugate of the input complex number.
- Parameters:
- z - the complex number to conjugate
- Returns:
- the conjugate
public Complex conj()
- Computes this's complex conjugate.
- Returns:
- this's conjugate
public static double modulus(Complex z)
- Computes the modulus of an input complex number.
- Parameters:
- z - the number whose modulus to compute
- Returns:
- the modulus
public double modulus()
- Compute this's modulus.
- Returns:
- this's modulus
public static double modsq(Complex z)
- Compute the modulus squared of a complex number.
- Parameters:
- z - the number whose modulus squared to compute
- Returns:
- the modulus square
public double modsq()
- Compute this's modulus squared.
- Returns:
- this's modulus squared
public static Complex stringToComplex(String s)
- Convert an input string to a complex number. Really should throw a
NumberFormatException if the string has an inappropriate form (which
would then have to be caught wherever this method is used!); instead,
returns the complex number i in such cases. Valid format of a string
is two numbers separated by a comma, indicating the real and imaginary
parts, respectively, of the complex number.
- Parameters:
- the - string to convert
- Returns:
- the complex number corresponding to that string
public static double distsq(Complex a, Complex b)
- Computes the square of the distance between two complex numbers.
- Parameters:
- a - one input complex number
- b - and another
- Returns:
- the square of the distance
public static String DoubleToString(double d)
- The default invocation of DoubleToString has DOUBLEDIGITS of
precision.
- Parameters:
- d - the double to be stringified
- Returns:
- the string version
public static String DoubleToString(double d, int res)
- Converts a double to a string with a certain number of digits of
precision.
- Parameters:
- d - the double to convert
- res - the number of digits of precision to use
public String toString()
- Convert this complex number to a string, with the real and imaginary
parts separated by a comma.
- Returns:
- the string version of this complex number
- Overrides:
- toString in class Object
public static Complex make_z11(Complex trace)
- Compute the (1,1) entry of the canonical matrix with given trace.
Answer will be the x such that x+x^{-1}=trace, in fact the one chosen
to have modulus greater than or equal to one.
- Parameters:
- trace - the trace of the matrix we are interested in
- Returns:
- the (1,1) entry of the corresponding canonical matrix
public static int make_maxpow(Complex trace, Complex z11)
- Compute the maxpow corresponding to the current trace and previously
calculated (1,1) entry. For purely hyerpbolic and parabolic elements,
always returns 1; for elliptic, returns half the order of the element,
up to value MAXELLIPORD; for loxodromic elements, the result is
valid for Ford domains, but is not known to be correct for Dirichlet
domains -- although we use it in that case as well.
- Parameters:
- trace - the current trace
- z11 - the (1,1) entry of the generator with that trace
- Returns:
- the corresponding Ford domain maxpow