[go: up one dir, main page]

Skip to content

levulinh/Solve-Complex-Equations-Set

Repository files navigation

Solve-Complex-Equations-Set

Solve the complex equations sets in android

How to input the coefficients?

For normal form:
a+bi, a+bj, a, bi, bj, a+j
with a, b are in double,
'i' or 'j' are the letter to define the complex number
Example:
3+2i, 3-5.3j, 3i

For Euler form:
r a phi
with r is the magnitude and phi is the argument of the complex number
phi in degree.
'a' or 'A' is the letter that separates r and phi
Example:
3a30, -2a45

You can input both form of complex numbers in the same equations set. Result returned in normal complex number form.

ComplexNumber(double re, double im) class

I provide you some operation of Complex number by using these methods:

ComplexNumber z = new ComplexNumber(re, im); 
//Interactions between two complex numbers
z.add(z1);
z.subtract(z1);
z.multiply(z1);
z.divide(re);
z.divide(z1);

//Operations of a complex number
z.conjugate();
z.opposite();

See more at ComplexNumber.class!

To clone a ComplexNumber object, use cloneFrom(ComplexNumber z) method.
For example:

//clone value of z1 to z
ComplexNumber z = new ComplexNumber();
z.cloneFrom(z1);

Matrix22, Matrix33, Matrix44 classes

These objects take a two-dimension array of ComplexNumber as the argument.
Method Matrix22.det() return a ComplexNumber that is the det of the Matrix. similar to Matrix33 and Matrix44.

##That's it, have fun##