// Project Three: An x-y point generator for a fern fractal // Author: Anna Woodard // Modified: January 29, 2008 (Volker Crede) // Creation Date: 22 January 2008 #include #include using namespace std; int main() { double x=0.5; // Output variables being initialized double y=0.0; double xnew=0.0; double ynew=0.0; const int m=10000; // Number of data points to be generated for (int i=0; i= 0.02 && r <= 0.17) { xnew = -0.139*x + 0.263*y + 0.57; ynew = 0.246*x + 0.224*y-0.036; } else if (r > 0.17 && r <= 0.3){ xnew = 0.17*x-0.215*y+0.408; ynew = 0.222*x + 0.176*y + 0.0893; } else if (r > 0.3 && r < 1) { xnew = 0.781*x + 0.034*y + 0.1075; ynew = -0.032*x + 0.739*y +0.27; } cout << xnew << " " << ynew << endl; x = xnew; y = ynew; } }