CODE
#include<iostream>
#include<iomanip>
#include<complex>
using std::cout;
using std::cin;
using std::endl;
using std::setw;
using std::complex;
int main()
{
double lowx, lowy, hix, hiy, x, k, t;
int row, colmn, m, varout;
cout << "Please input the upper left x,y coordinate :"
<< endl;
cin >> hix >> hiy;
cout << "Please input the bottom right x,y coordinate : "
<< endl;
cin >> lowx >> lowy;
cout << "Please insert the number of rows and columns to be output: "
<< endl;
cin >> row >> colmn;
m = 1;
varout = 1;
k = (lowx - hix) / (outp - 1);
t = (hiy - lowy) / outp - 1);
while(varout <= outp)
{
x = hix;
while (outp >= m)
{
cout.precision(2);
complex<double> cpn1(x, hiy);
complex<double> cpn2(x, hiy);
double max_iter = 20;
double iteration = 0;
while( iteration <= max_iter )
{
cpn2 = cpn2 * cpn2 + cpn1;
double mag = abs(cpn2);
if(( mag > 2.0) || ( iteration >= max_iter))
{
cout << setw(3) << iteration;
break;
}
++iteration;
}
++m;
x = x + k;
}
cout << endl;
m = 1;
++varout;
hiy = hiy - t;
}
return 0;
}
Im trying to set this mandelbrot program to it takes seven inputs: 4 points, the number of rows, the number of columns, and the max iterations but im having trouble figuring out how to set the program up so that it takes the user inputs for rows and columns and outputs it right. any tips or help would be greatly appriciated.