/************************************************************** * BEAUTY OF CHAOS * * ----------------------------------------------------------- * * The two scientists Gumowski and Mira proposed in their * * publications the following iterative model: * * * * x n+1 = b.y n + F(x n) * * y n+1 = -x n + F(x n+1) * * * * with F(x) = a.x + (2(1-a)x²)/(1+x²) * * * * According to the value of parameters a and b, and the * * coordinates of the starting point, the achieved drawing can * * have a surprising beauty. * * ----------------------------------------------------------- * * Some interesting combinations: * * a=0.1 b=0.99 x0=3 yy0=0 iter=30000 f1=-8 f2=8 f3=-6 f4=6 * * a=0.01 b=0.96 x0=5 yy0=0 iter=25000 f1=-12 f2=12 f3=-8 f4=8 * * a=0.32 b=1 x0=-5 yy0=0 iter=30000 f1=-16 f2=16 f3=-12 f4=12 * * a=0.31 b=1 x0=12 yy0=0 iter=30000 f1=-40 f2=40 f3=-25 f4=25 * * Can you find other ones ? * * ----------------------------------------------------------- * * From "Graphisme dans le plan et dans l'espace avec Turbo * * Pascal 4.0 de R. Dony - MASSON 1990, page 198" * * [BIBLI 12]. * * * * Visual C++ version by J-P Moreau, Paris * * (www.jpmoreau.fr) * * * * Uses: Mira.mak, Gr2d.cpp * **************************************************************/ #include #include #include #include HDC hdc; RECT rect; //Functions used here of module Gr2D.cpp void Fenetre(double,double,double,double); void Cloture(int,int,int,int); void Bordure(); void PleinEcran(); void MoveXY(double,double); void LineXY(double,double); //"home made" graphic commands for hdc environment used by above functions void DrawPixel(int ix,int iy) { //sorry, no other available command found Rectangle(hdc,rect.left+ix,rect.top+iy, rect.left+ix+2,rect.top+iy+1); } void Swap(int *i1,int *i2) { int it; it=*i1; *i1=*i2; *i2=it; } void DrawLine(int ix1,int iyy1,int ix2,int iy2) { int i,il,ix,iy; double dx,dy; if (ix2