File:Herman-ring-1.png
From testwiki
Jump to navigation
Jump to search
Size of this preview: 800 × 400 pixels. Other resolutions: 320 × 160 pixels | 640 × 320 pixels | 1,024 × 512 pixels | 1,280 × 640 pixels | 4,000 × 2,000 pixels.
Original file (4,000 × 2,000 pixels, file size: 512 KB, MIME type: image/png)
This file is from Wikimedia Commons and may be used by other projects. The description on its file description page there is shown below.
Summary
| DescriptionHerman-ring-1.png |
English: Julia set for rational map with Herman rings.
|
| Date | |
| Source | Own work |
| Author | Ilya Voyager |
Licensing
I, the copyright holder of this work, hereby publish it under the following licenses:
This file is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported, 2.5 Generic, 2.0 Generic and 1.0 Generic license.
- You are free:
- to share – to copy, distribute and transmit the work
- to remix – to adapt the work
- Under the following conditions:
- attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
- share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
| Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled GNU Free Documentation License.http://www.gnu.org/copyleft/fdl.htmlGFDLGNU Free Documentation Licensetruetrue |
You may select the license of your choice.
Compare with :
-
better quality image, without src code
Source code
This is a Julia set of the following rational map:
where t=0.6151732.
We used rather straightforward boundary scanning method (see e.g. D. Saupe, Efficient computation of Julia sets and their fractal dimension, Physica D, v.28 n.3, p.358-370, Oct. 1987 [1][dead link]). C++ source code follows. It's available under CC BY-SA, GFDL and GPLv2+.
See also discussion for some notes about compiling and running the program.
#include <stdlib.h>
#include <math.h>
#include <time.h>
#include <iostream>
#include <complex>
inline double max(double a,double b)
{
return a>b?a:b;
}
using namespace std;
const double t=0.6151732;
const complex<double> rot=exp(2*M_PI*complex<double>(0,1)*t);//e^{2 \pi i t}
complex<double> f(complex<double> z)
{
// f(z) = e^{2 \pi i t}\cdot \frac{z^2(z - 4)}{1 - 4z},
return rot*(z*z*(z-4.))/(complex<double>(1,0)-4.*z);
}
int main()
{
//z=x+iy;
double xmin=-4.0,xmax=8.0,deltax,ymin=-3,ymax=3,deltay;
int precx=400, precy=200;
deltax=(xmax-xmin)/precx;
deltay=(ymax-ymin)/precy;
int iterations=4000;
double threshold=iterations/30*sqrt(deltax*deltax+deltay*deltay);
double x,y;
complex<double> zlt,zlb,zrt,zrb;
int i,k,l;
double maxdistance;
int color, MaxColor=15;
double infty=1.E4;
bool inf_zlt,inf_zlb,inf_zrt,inf_zrb;
cout << "P2" << endl << precx << " " << precy << endl << MaxColor << endl;
for(k=0;k<precy;k++)
{
y=ymax-k*deltay;
cerr << y << endl;
for(l=0;l<precx;l++)
{
x=xmin+l*deltax;
zlt=complex<double>(x-deltax/2,y+deltay/2);
zlb=complex<double>(x-deltax/2,y-deltay/2);
zrt=complex<double>(x+deltax/2,y+deltay/2);
zrb=complex<double>(x+deltax/2,y-deltay/2);
inf_zlt=false;
inf_zlb=false;
inf_zrt=false;
inf_zrb=false;
for(i=0;i<iterations;i++)
{
if(!inf_zlt){zlt=f(zlt);}
if(!inf_zlb){zlb=f(zlb);}
if(!inf_zrt){zrt=f(zrt);}
if(!inf_zrb){zrb=f(zrb);}
if(abs(zlt)>infty)
{
zlt=infty;
inf_zlt=true;
}
if(abs(zrt)>infty)
{
zrt=infty;
inf_zrt=true;
}
if(abs(zlb)>infty)
{
zlb=infty;
inf_zlb=true;
}
if(abs(zrb)>infty)
{
zrb=infty;
inf_zrb=true;
}
}
maxdistance=max(abs(zlt-zlb),max(abs(zlt-zrt),max(abs(zlt-zrb),max(abs(zlb-zrt),max(abs(zlb-zrb),abs(zrt-zrb))))));
if(maxdistance>threshold*8)
{
color=0;
}
else
{
if(maxdistance<threshold/8.)
{
color=MaxColor;
}
else
{
color=MaxColor-(int(log(maxdistance/threshold)/log(8)*7.)+7);
}
}
//if (x>0 && y>0) color=MaxColor-color; /* check the orientation of Z-plane by marking first quadrant */
cout << color << " ";
}
cout << endl;
}
return 0;
}
Captions
Add a one-line explanation of what this file represents
Items portrayed in this file
depicts
3 March 2010
524,438 byte
2,000 pixel
4,000 pixel
image/png
31f9f6d810cb0d7b5a4ab88921aa238eda48e89f
File history
Click on a date/time to view the file as it appeared at that time.
| Date/Time | Thumbnail | Dimensions | User | Comment | |
|---|---|---|---|---|---|
| current | 19:18, 15 July 2011 | 4,000 × 2,000 (512 KB) | wikimediacommons>Soul windsurfer | reversed Y axis and bigger size |
File usage
The following page uses this file: