The tricorn (a fractal similar to the Mandelbrot set), plotted in the area [−2, 2) × [−2, 2). The value of each pixel equals 255 minus the number of iterations needed before the absolute value of z becomes larger than 2, calculated at the upper left corner of the pixel.
The following C code was used to create a negative PGM image:
#include <stdio.h>
#include <limits.h>
main() {
unsigned int resx = 4096, resy = 4096; //Resolution;
unsigned char i = 0; //Iteration counter;
float xmin = -2, xmax = +2; //Borders of the area
float ymin = -2, ymax = +2; //to be plotted;
unsigned int xpix = 0, ypix = 0; //Column and row counters;
float x, y; //Coordinates;
long double Rez, Imz, Rez_new, Imz_new; //Real and imaginary parts.
FILE *f;
f = fopen("tricorn.pgm", "w");
fprintf(f, "P2\n%d %d\n%d\n", resx, resy, UCHAR_MAX); //Portable Greymap file header
for (ypix = 0; ypix < resy; ypix++) {
for (xpix = 0; xpix < resx; xpix++) {
x = xmin + xpix * (xmax - xmin)/resx;
y = ymin + ypix * (ymax - ymin)/resy;
Rez = x; Imz = y;
for (i = 0; Rez*Rez + Imz*Imz <= 4; i++) { //z = conj(z^2) + c
Rez_new = Rez*Rez - Imz*Imz + x; //(It'd be z = z^2 +c for Mandelbrot)
Imz_new = -2*Rez*Imz + y; //remove minus sign here to obtain the Mandelbrot set
Rez = Rez_new;
Imz = Imz_new;
if (i == UCHAR_MAX) break; }
fprintf(f, "%d ", i); }
fprintf(f, "\n"); }
}
Then I used the GIMP to invert colors, reduce to 25% and save it as PNG.
Licensing
I, the copyright holder of this work, hereby publish it under the following licenses:
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.
This licensing tag was added to this file as part of the GFDL licensing update.http://creativecommons.org/licenses/by-sa/3.0/CC BY-SA 3.0Creative Commons Attribution-Share Alike 3.0truetrue
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. Subject to disclaimers.http://www.gnu.org/copyleft/fdl.htmlGFDLGNU Free Documentation Licensetruetrue
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.
The tricorn (a fractal similar to the Mandelbrot set), plotted in the area [−2, 2) × [−2, 2). The value of each pixel equals 255 minus the number of iterations needed before the absolute value of z becomes larger than 2, calculated at the upper left
The tricorn (a fractal similar to the Mandelbrot set), plotted in the area [−2, 2] × [−2, 2]. The value of each pixel equals 255 minus the number of iterations needed before the absolute value of ''z'' becomes larger than 2, calculated at the upper l
File usage
No pages on the English Wikipedia use this file (pages on other projects are not listed).