Hi Aurel,
No computer (even no human) can do even something simple as adding two complex numbers ... it has to be split in a real and imaginary part.
The basics are -- complex numbers written as Z1=(a,b) and Z2=(c,d)
(a,b)+(c,d) = (a+c , b+d)
(a,b)-(c,d) = (a-c , b-d) because m*(c,d) = (mc,md) consequently -(c,d) = -1*(c,d) = (-c,-d)
(a,b)*(c,d) = (ac - bd , bc + ad) consequently (a,b)² = (a²-b², 2*a*b)
(a,b)/(c,d) = m*(ac+bd , bc-ad) where m=c²+d² a real number. (it is done by multiplying with the conjugate complex number )
you will have to do Z*Z*Z*Z*Z*Z for Z^6 , the FBmath module does A=Z*Z*Z en then Z^6 = A*A as an example.
best to declare :
type complex
r as single
i as single
end type
z as complex gives z.r (real part) and z.i (imag part )
with this you can do this in any language.
oops , forgot the magnitude (modulus)
that's the length of the vector
by Pythagoras rule cabs(a,b) = sqrt(a*a + b*b)
best Rob
addendum : in many math programs , the sqrt is just skipped (because expensive) , you better square your criterium .
x < sqrt 5 is the same as x² < 5 if x > 0 this is done in all those Mandelbrot progs ..