Complex

Inheritance: java.lang.Object, com.aspose.ms.System.ValueType, com.aspose.ms.lang.Struct

All Implemented Interfaces: com.aspose.ms.System.IEquatable

public class Complex extends Struct<Complex> implements System.IEquatable<Complex>

The complex number structure.

Constructors

ConstructorDescription
Complex()
Complex(double real, double imaginary)Initializes a new instance of the Complex struct.
Complex(Complex c)Initializes a new instance of the Complex struct.

Fields

FieldDescription
SIZE_OF_DOUBLEThe size of double.
SIZE_OF_COMPLEXThe size of complex.
ZEROZero complex.
ONEOne complex having Re(.getRe/.setRe(double)) and Im(.getIm/.setIm(double)) equal to 1.
II complex having Im(.getIm/.setIm(double)) equal to 1.

Methods

MethodDescription
to_Complex(double value)Performs an explicit conversion from double to Complex.
to_Complex(float value)Performs an explicit conversion from float to Complex.
op_Equality(Complex a, Complex b)Implements the operator ==.
op_Inequality(Complex a, Complex b)Implements the operator !=.
op_UnaryNegation(Complex a)Implements the operator -.
op_Addition(Complex a, Complex b)Implements the operator +.
op_Addition(Complex a, double s)Implements the operator +.
op_Addition(double s, Complex a)Implements the operator +.
op_Subtraction(Complex a, Complex b)Implements the operator -.
op_Subtraction(Complex a, double s)Implements the operator -.
op_Subtraction(double s, Complex a)Implements the operator -.
op_Multiply(Complex a, Complex b)Implements the operator *.
op_Multiply(double s, Complex a)Implements the operator *.
op_Multiply(Complex a, double s)Implements the operator *.
op_Division(Complex a, Complex b)Implements the operator /.
op_Division(Complex a, double s)Implements the operator /.
op_Division(double s, Complex a)Implements the operator /.
add(Complex a, Complex b)Adds a and b.
add(Complex a, double s)Adds a and s.
add(Complex a, Complex b, Complex[] result)Adds a and b.
add(Complex a, double s, Complex[] result)Adds a and s.
subtract(Complex a, Complex b)Subtracts b from a.
subtract(Complex a, double s)Subtracts s from a.
subtract(double s, Complex a)Subtracts s from a.
subtract(Complex a, Complex b, Complex[] result)Subtracts b from a.
subtract(Complex a, double s, Complex[] result)Subtracts s from a.
subtract(double s, Complex a, Complex[] result)Subtracts a from s.
multiply(Complex a, Complex b)Multiplies a by b.
multiply(Complex a, double s)Multiplies a by s.
multiply(Complex a, Complex b, Complex[] result)Multiplies a by b.
multiply(Complex a, double s, Complex[] result)Multiplies a by s.
divide(Complex a, Complex b)Divides a by b.
divide(Complex a, double s)Divides a by s.
divide(double s, Complex a)Divides a by s.
divide(Complex a, Complex b, Complex[] result)Divides a by b.
divide(Complex a, double s, Complex[] result)Divides a by s.
divide(double s, Complex a, Complex[] result)Divides s by a.
negate(Complex a)Negates a.
approxEqual(Complex a, Complex b)Checks approximate equality.
approxEqual(Complex a, Complex b, double tolerance)Checks approximate equality.
parse(String s)Parses the specified s into a Complex.
tryParse(String s, Complex[] result)Tries to parse the specified s into a Complex.
sqrt(Complex a)Gets square root of a.
log(Complex a)Gets log of a.
exp(Complex a)Raises e by a.
sin(Complex a)Gets Sin of a.
cos(Complex a)Gets Cos of a.
tan(Complex a)Gets Tan of a.
isEquals(Complex obj1, Complex obj2)
multiply_internalize(double s)Multiplies by s.
getRe()Gets the real part.
setRe(double value)Sets the real part.
getIm()Gets the imaginary part.
setIm(double value)Sets the imaginary part.
set(double re, double im)Sets the values and returns itself.
getMagnitude()Gets the magnitude.
getPhase()Gets the phase.
getSquaredMagnitude()Gets the squared magnitude.
hashCode()Returns a hash code for this instance.
equals(Object obj)Determines whether the specified Object, is equal to this instance.
toString()Returns a String that represents this instance.
deepClone()Clones this instance.
CloneTo(Complex that)
Clone()

Complex()

public Complex()

Complex(double real, double imaginary)

public Complex(double real, double imaginary)

Initializes a new instance of the Complex struct.

Parameters:

ParameterTypeDescription
realdoubleThe real part.
imaginarydoubleThe imaginary part.

Complex(Complex c)

public Complex(Complex c)

Initializes a new instance of the Complex struct.

Parameters:

ParameterTypeDescription
cComplexThe complex number.

SIZE_OF_DOUBLE

public static final int SIZE_OF_DOUBLE

The size of double.

SIZE_OF_COMPLEX

public static final int SIZE_OF_COMPLEX

The size of complex.

ZERO

public static final Complex ZERO

Zero complex.

ONE

public static final Complex ONE

One complex having Re(.getRe/.setRe(double)) and Im(.getIm/.setIm(double)) equal to 1.

I

public static final Complex I

I complex having Im(.getIm/.setIm(double)) equal to 1.

to_Complex(double value)

public static Complex to_Complex(double value)

Performs an explicit conversion from double to Complex.

Parameters:

ParameterTypeDescription
valuedoubleThe value.

Returns: Complex - The result of the conversion.

to_Complex(float value)

public static Complex to_Complex(float value)

Performs an explicit conversion from float to Complex.

Parameters:

ParameterTypeDescription
valuefloatThe value.

Returns: Complex - The result of the conversion.

op_Equality(Complex a, Complex b)

public static boolean op_Equality(Complex a, Complex b)

Implements the operator ==.

Parameters:

ParameterTypeDescription
aComplexThe “a” complex.
bComplexThe b complex.

Returns: boolean - The result of the operator.

op_Inequality(Complex a, Complex b)

public static boolean op_Inequality(Complex a, Complex b)

Implements the operator !=.

Parameters:

ParameterTypeDescription
aComplexThe “a” complex.
bComplexThe b complex.

Returns: boolean - The result of the operator.

op_UnaryNegation(Complex a)

public static Complex op_UnaryNegation(Complex a)

Implements the operator -.

Parameters:

ParameterTypeDescription
aComplexThe “a” complex.

Returns: Complex - The result of the operator.

op_Addition(Complex a, Complex b)

public static Complex op_Addition(Complex a, Complex b)

Implements the operator +.

Parameters:

ParameterTypeDescription
aComplexThe “a” complex.
bComplexThe b complex.

Returns: Complex - The result of the operator.

op_Addition(Complex a, double s)

public static Complex op_Addition(Complex a, double s)

Implements the operator +.

Parameters:

ParameterTypeDescription
aComplexThe “a” complex.
sdoubleThe s value.

Returns: Complex - The result of the operator.

op_Addition(double s, Complex a)

public static Complex op_Addition(double s, Complex a)

Implements the operator +.

Parameters:

ParameterTypeDescription
sdoubleThe s value.
aComplexThe “a” complex.

Returns: Complex - The result of the operator.

op_Subtraction(Complex a, Complex b)

public static Complex op_Subtraction(Complex a, Complex b)

Implements the operator -.

Parameters:

ParameterTypeDescription
aComplexThe “a” complex.
bComplexThe b complex.

Returns: Complex - The result of the operator.

op_Subtraction(Complex a, double s)

public static Complex op_Subtraction(Complex a, double s)

Implements the operator -.

Parameters:

ParameterTypeDescription
aComplexThe “a” complex.
sdoubleThe s value.

Returns: Complex - The result of the operator.

op_Subtraction(double s, Complex a)

public static Complex op_Subtraction(double s, Complex a)

Implements the operator -.

Parameters:

ParameterTypeDescription
sdoubleThe s value.
aComplexThe “a” complex.

Returns: Complex - The result of the operator.

op_Multiply(Complex a, Complex b)

public static Complex op_Multiply(Complex a, Complex b)

Implements the operator *.

Parameters:

ParameterTypeDescription
aComplexThe “a” complex.
bComplexThe b complex.

Returns: Complex - The result of the operator.

op_Multiply(double s, Complex a)

public static Complex op_Multiply(double s, Complex a)

Implements the operator *.

Parameters:

ParameterTypeDescription
sdoubleThe s value.
aComplexThe “a” complex.

Returns: Complex - The result of the operator.

op_Multiply(Complex a, double s)

public static Complex op_Multiply(Complex a, double s)

Implements the operator *.

Parameters:

ParameterTypeDescription
aComplexThe “a” complex.
sdoubleThe s value.

Returns: Complex - The result of the operator.

op_Division(Complex a, Complex b)

public static Complex op_Division(Complex a, Complex b)

Implements the operator /.

Parameters:

ParameterTypeDescription
aComplexThe “a” complex.
bComplexThe b complex.

Returns: Complex - The result of the operator.

op_Division(Complex a, double s)

public static Complex op_Division(Complex a, double s)

Implements the operator /.

Parameters:

ParameterTypeDescription
aComplexThe “a” complex.
sdoubleThe s value.

Returns: Complex - The result of the operator.

op_Division(double s, Complex a)

public static Complex op_Division(double s, Complex a)

Implements the operator /.

Parameters:

ParameterTypeDescription
sdoubleThe s value.
aComplexThe “a” complex.

Returns: Complex - The result of the operator.

add(Complex a, Complex b)

public static Complex add(Complex a, Complex b)

Adds a and b.

Parameters:

ParameterTypeDescription
aComplexThe “a” complex.
bComplexThe b complex.

Returns: Complex - The sum complex.

add(Complex a, double s)

public static Complex add(Complex a, double s)

Adds a and s.

Parameters:

ParameterTypeDescription
aComplexThe “a” complex.
sdoubleThe s value.

Returns: Complex - The complex with its Re increased by s.

add(Complex a, Complex b, Complex[] result)

public static void add(Complex a, Complex b, Complex[] result)

Adds a and b.

Parameters:

ParameterTypeDescription
aComplexThe “a” complex.
bComplexThe b complex.
resultComplex[]The result.

add(Complex a, double s, Complex[] result)

public static void add(Complex a, double s, Complex[] result)

Adds a and s.

Parameters:

ParameterTypeDescription
aComplexThe “a” complex.
sdoubleThe s value.
resultComplex[]The result.

subtract(Complex a, Complex b)

public static Complex subtract(Complex a, Complex b)

Subtracts b from a.

Parameters:

ParameterTypeDescription
aComplexThe “a” complex.
bComplexThe b complex.

Returns: Complex - The result of subtraction.

subtract(Complex a, double s)

public static Complex subtract(Complex a, double s)

Subtracts s from a.

Parameters:

ParameterTypeDescription
aComplexThe “a” complex.
sdoubleThe s value.

Returns: Complex - The result of subtraction.

subtract(double s, Complex a)

public static Complex subtract(double s, Complex a)

Subtracts s from a.

Parameters:

ParameterTypeDescription
sdoubleThe s value.
aComplexThe “a” complex.

Returns: Complex - The result of subtraction.

subtract(Complex a, Complex b, Complex[] result)

public static void subtract(Complex a, Complex b, Complex[] result)

Subtracts b from a.

Parameters:

ParameterTypeDescription
aComplexThe “a” complex.
bComplexThe b complex.
resultComplex[]The result.

subtract(Complex a, double s, Complex[] result)

public static void subtract(Complex a, double s, Complex[] result)

Subtracts s from a.

Parameters:

ParameterTypeDescription
aComplexThe “a” complex.
sdoubleThe s value.
resultComplex[]The result.

subtract(double s, Complex a, Complex[] result)

public static void subtract(double s, Complex a, Complex[] result)

Subtracts a from s.

Parameters:

ParameterTypeDescription
sdoubleThe s value.
aComplexThe “a” complex.
resultComplex[]The result.

multiply(Complex a, Complex b)

public static Complex multiply(Complex a, Complex b)

Multiplies a by b.

Parameters:

ParameterTypeDescription
aComplexThe “a” complex.
bComplexThe b complex.

Returns: Complex - The result of multiplication.

multiply(Complex a, double s)

public static Complex multiply(Complex a, double s)

Multiplies a by s.

Parameters:

ParameterTypeDescription
aComplexThe “a” complex.
sdoubleThe s value.

Returns: Complex - The result of multiplication.

multiply(Complex a, Complex b, Complex[] result)

public static void multiply(Complex a, Complex b, Complex[] result)

Multiplies a by b.

Parameters:

ParameterTypeDescription
aComplexThe “a” complex.
bComplexThe b complex.
resultComplex[]The result.

multiply(Complex a, double s, Complex[] result)

public static void multiply(Complex a, double s, Complex[] result)

Multiplies a by s.

Parameters:

ParameterTypeDescription
aComplexThe “a” complex.
sdoubleThe s value.
resultComplex[]The result.

divide(Complex a, Complex b)

public static Complex divide(Complex a, Complex b)

Divides a by b.

Parameters:

ParameterTypeDescription
aComplexThe “a” complex.
bComplexThe b complex.

Returns: Complex - The result of division.

divide(Complex a, double s)

public static Complex divide(Complex a, double s)

Divides a by s.

Parameters:

ParameterTypeDescription
aComplexThe “a” complex.
sdoubleThe s value.

Returns: Complex - The result of division.

divide(double s, Complex a)

public static Complex divide(double s, Complex a)

Divides a by s.

Parameters:

ParameterTypeDescription
sdoubleThe s value.
aComplexThe “a” complex.

Returns: Complex - The result of division.

divide(Complex a, Complex b, Complex[] result)

public static void divide(Complex a, Complex b, Complex[] result)

Divides a by b.

Parameters:

ParameterTypeDescription
aComplexThe “a” complex.
bComplexThe b complex.
resultComplex[]The result.

divide(Complex a, double s, Complex[] result)

public static void divide(Complex a, double s, Complex[] result)

Divides a by s.

Parameters:

ParameterTypeDescription
aComplexThe “a” complex.
sdoubleThe s value.
resultComplex[]The result.

divide(double s, Complex a, Complex[] result)

public static void divide(double s, Complex a, Complex[] result)

Divides s by a.

Parameters:

ParameterTypeDescription
sdoubleThe s value.
aComplexThe “a” complex.
resultComplex[]The result.

negate(Complex a)

public static Complex negate(Complex a)

Negates a.

Parameters:

ParameterTypeDescription
aComplexThe “a” complex.

Returns: Complex - The result of negation.

approxEqual(Complex a, Complex b)

public static boolean approxEqual(Complex a, Complex b)

Checks approximate equality.

Parameters:

ParameterTypeDescription
aComplexThe “a” complex.
bComplexThe b complex.

Returns: boolean - The approximate equality result.

approxEqual(Complex a, Complex b, double tolerance)

public static boolean approxEqual(Complex a, Complex b, double tolerance)

Checks approximate equality.

Parameters:

ParameterTypeDescription
aComplexThe “a” complex.
bComplexThe b complex.
tolerancedoubleThe tolerance.

Returns: boolean - The approximate equality result.

parse(String s)

public static Complex parse(String s)

Parses the specified s into a Complex.

Parameters:

ParameterTypeDescription
sjava.lang.StringThe s value.

Returns: Complex - The complex number.

tryParse(String s, Complex[] result)

public static boolean tryParse(String s, Complex[] result)

Tries to parse the specified s into a Complex.

Parameters:

ParameterTypeDescription
sjava.lang.StringThe s value.
resultComplex[]The result.

Returns: boolean - True, if the complex number is parsed.

sqrt(Complex a)

public static Complex sqrt(Complex a)

Gets square root of a.

Parameters:

ParameterTypeDescription
aComplexThe “a” complex.

Returns: Complex - The square root.

log(Complex a)

public static Complex log(Complex a)

Gets log of a.

Parameters:

ParameterTypeDescription
aComplexThe “a” complex.

Returns: Complex - The log of a.

exp(Complex a)

public static Complex exp(Complex a)

Raises e by a.

Parameters:

ParameterTypeDescription
aComplexThe “a” complex.

Returns: Complex - e raised by a.

sin(Complex a)

public static Complex sin(Complex a)

Gets Sin of a.

Parameters:

ParameterTypeDescription
aComplexThe “a” complex.

Returns: Complex - Sin of a.

cos(Complex a)

public static Complex cos(Complex a)

Gets Cos of a.

Parameters:

ParameterTypeDescription
aComplexThe “a” complex.

Returns: Complex - Cos of a.

tan(Complex a)

public static Complex tan(Complex a)

Gets Tan of a.

Parameters:

ParameterTypeDescription
aComplexThe “a” complex.

Returns: Complex - Tan of a.

isEquals(Complex obj1, Complex obj2)

public static boolean isEquals(Complex obj1, Complex obj2)

Parameters:

ParameterTypeDescription
obj1Complex
obj2Complex

Returns: boolean

multiply_internalize(double s)

public Complex multiply_internalize(double s)

Multiplies by s.

Parameters:

ParameterTypeDescription
sdoubleThe s value.

Returns: Complex - The result of multiplication.

getRe()

public final double getRe()

Gets the real part.

Returns: double - the real part.

setRe(double value)

public final void setRe(double value)

Sets the real part.

Parameters:

ParameterTypeDescription
valuedoublethe real part.

getIm()

public final double getIm()

Gets the imaginary part.

Returns: double - the imaginary part.

setIm(double value)

public final void setIm(double value)

Sets the imaginary part.

Parameters:

ParameterTypeDescription
valuedoublethe imaginary part.

set(double re, double im)

public final Complex set(double re, double im)

Sets the values and returns itself.

Parameters:

ParameterTypeDescription
redoubleThe Re value.
imdoubleThe Im value.

Returns: Complex - The object itself.

getMagnitude()

public final double getMagnitude()

Gets the magnitude.

Value: The magnitude.

Returns: double - the magnitude.

getPhase()

public final double getPhase()

Gets the phase.

Value: The phase.

Returns: double - the phase.

getSquaredMagnitude()

public final double getSquaredMagnitude()

Gets the squared magnitude.

Value: The squared magnitude.

Returns: double - the squared magnitude.

hashCode()

public int hashCode()

Returns a hash code for this instance.

Returns: int - A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.

equals(Object obj)

public boolean equals(Object obj)

Determines whether the specified Object, is equal to this instance.

Parameters:

ParameterTypeDescription
objjava.lang.ObjectThe Object to compare with this instance.

Returns: boolean - true if the specified Object is equal to this instance; otherwise, false.

toString()

public String toString()

Returns a String that represents this instance.

Returns: java.lang.String - A String that represents this instance.

deepClone()

public final Complex deepClone()

Clones this instance.

Returns: Complex - A clone of this complex.

CloneTo(Complex that)

public void CloneTo(Complex that)

Parameters:

ParameterTypeDescription
thatComplex

Clone()

public Complex Clone()

Returns: Complex