Below I described a complex polynomial which is a part of my newton method. When I define the complex number [x = new ComplexNumber (0,0)] it only returns 0 or 1. Also I have overriden the basic string format to make it look like a complex number, but it doesn't show. As a beginner I am clueless.
btw I have defined all the methods which are used in the code below and tested them, they all work and the output is like expected.
note: the polynomial is in fractions(part+part...). First I split up the polynomial into a real and an imaginary bit, but then i had problems with defining a complex root.
public static ComplexNumber p(ComplexNumber x){
ComplexNumber a = new ComplexNumber(1,0);
ComplexNumber b = new ComplexNumber(0,1);
ComplexNumber c = new ComplexNumber(2,0);
ComplexNumber d = new ComplexNumber(0,3);
return ((a.add(b.mul(x))).add((c.add(d))).mul(x.power(6)));
}
thanks in advance