Hi All
I am having a go at a small program to draw a fractal, though I am not sure on how to represent the
imaginary part of the complex number.
Most examples I have seen use a pair of doubles, though I can't see how they are representing i.
The one I am looking at now is coded in C++ as
// Function that multiplies two complex numbers
// the result is a modified object of the class (this)
void Multiply(Complex_Number comp_num)
{
double temp_a;
double temp_b;
temp_a = this->a * comp_num.a;
temp_a += (this->b * comp_num.b)*(-1);
temp_b = this->a * comp_num.b;
temp_b += this->b * comp_num.a;
this->a = temp_a;
this->b = temp_b;
}
then multiplying the b value by -1. I thought only
was equal to -1.
It's probably just me being thick, though if someone could explain how this is working
that would be cool.
Thanks
David