File:Bogdanov map.png
From Wikimedia Commons, the free media repository
Jump to navigation
Jump to search
Bogdanov_map.png (489 × 375 pixels, file size: 78 KB, MIME type: image/png)
File information
Structured data
Captions
Captions
Example of Bogdanov map, with e=0, k=1.2, m=0
Summary
[edit]DescriptionBogdanov map.png |
English: Bogdanov map : |
Date | |
Source | Own work |
Author | Claudio Rocchini |
Source code
[edit]#include <stdio.h>
#include <stdlib.h>
#include <vector>
int main() {
const int dimx = 1024; /* Image dimension */
const int dimy = 1024;
std::vector<size_t> I(dimx * dimy);
for (int i = 0; i < dimx * dimy; ++i) I[i] = 0;
const double e = 0; /* brith and grow */
const double k = 1.2; /* Discretization */
const double m = 0; /* stability */
const double step = 0.03; /* Initial point step */
for (double oy = -1.0; oy <= 1.0; oy += step) {
for (double ox = -0.7; ox <= 1.3; ox += step) {
if (ox == 0 || oy == 0) continue; /* Avoid origin */
double x = ox;
double y = oy;
for (size_t q = 0; q < 100000; ++q) {
y = y + e * y + k * x * (x - 1) + m * x * y;
x = x + y;
if (fabs(x) > 2 || fabs(y) > 2) break; /* the map diverge */
double imx = (x - 0.3) * dimx / 2 + dimx / 2;
double imy = y * dimy / 2 + dimy / 2;
if (fabs(x) > 1e-6 || fabs(y) > 1e-6) { /* Avoid origin */
int ix = int(imx + 0.5);
int iy = int(imy + 0.5);
if (ix >= 0 && ix < dimx && iy >= 0 && iy < dimy)
I[size_t(dimx) * (dimy - 1 - iy) + ix] ++;
}
}
}
}
size_t maxd = I[0]; /* Compute max frequency */
for (int i = 0; i < dimx * dimy; ++i)
if (maxd < I[i]) maxd = I[i];
FILE* fo = fopen("c:\\temp\\bogdanov_map2.pgm", "wb");
fprintf(fo, "P5\n%d %d\n255\n", dimx, dimy);
for (int i = 0; i < dimx * dimy; ++i) {
int v = I[i] == 0 ? 0 : int(32 + (256 - 32) * I[i] / maxd + 0.5); if (v > 255) v = 255;
unsigned char b = 255 - (unsigned char)v;
fwrite(&b, 1, 1, fo);
}
fclose(fo);
return 0;
}
Licensing
[edit]I, the copyright holder of this work, hereby publish it under the following license:
![w:en:Creative Commons](https://upload.wikimedia.org/wikipedia/commons/thumb/7/79/CC_some_rights_reserved.svg/90px-CC_some_rights_reserved.svg.png)
![attribution](https://upload.wikimedia.org/wikipedia/commons/thumb/1/11/Cc-by_new_white.svg/24px-Cc-by_new_white.svg.png)
![share alike](https://upload.wikimedia.org/wikipedia/commons/thumb/d/df/Cc-sa_white.svg/24px-Cc-sa_white.svg.png)
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International 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.
File history
Click on a date/time to view the file as it appeared at that time.
Date/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 12:03, 13 May 2020 | ![]() | 489 × 375 (78 KB) | Rocchini (talk | contribs) | Uploaded own work with UploadWizard |
You cannot overwrite this file.
File usage on Commons
There are no pages that use this file.
File usage on other wikis
The following other wikis use this file:
- Usage on en.wikipedia.org
Metadata
This file contains additional information such as Exif metadata which may have been added by the digital camera, scanner, or software program used to create or digitize it. If the file has been modified from its original state, some details such as the timestamp may not fully reflect those of the original file. The timestamp is only as accurate as the clock in the camera, and it may be completely wrong.
Horizontal resolution | 28.35 dpc |
---|---|
Vertical resolution | 28.35 dpc |
File change date and time | 12:58, 13 May 2020 |