Complex Number
Create a structure that represents complex numbers and the following functions:
// Prints a complex number in the form "a + bi".
void print_complex(Complex& fraction)
// Returns a new complex number that is the sum of lhs and rhs.
Complex add(Complex& lhs, Complex& rhs)
// Returns a new complex number that is the product of lhs and rhs.
Complex mult(Complex& lhs, Complex& rhs)
// Returns the absolue value of complex.
double abs(Complex& complex)
// Returns the escape distance of the quadratic polynomial
// function using a loop.
int escape_distance(Complex& complex, int max_iterations)
For each function, other than print_complex
, include a function that tests it.