Datei:Mandelbrot Set Image 31.png
Inhaltsverzeichnis
Diese Datei stammt aus Wikimedia Commons und kann von anderen Projekten verwendet werden. Die Beschreibung von deren Dateibeschreibungsseite wird unten angezeigt.
Beschreibung
| BeschreibungMandelbrot Set Image 31.png |
Русский: Фрагмент множества Мандельброта, координаты центра: -0.0976106489038042, 0.8441497946098066, ширина изображения 0.0000000000000094
English: Fragment of the Mandelbrot set, coordinates: -0.0976106489038042, 0.8441497946098066, width 0.0000000000000094
|
| Datum | |
| Quelle | Eigenes Werk |
| Urheber | Aokoroko |
Quelltext (C++)
#include <iostream>
#include <fstream>
#include <vector>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <thread>
#include <atomic>
const long double absc = -0.0976106489038042L;
const long double ordi = 0.8441497946098066L;
const long double size_val = 0.0000000000000094L;
const int PALETTE = 20;
const int horiz = 10800;
const int vert = 10800;
void worker_thread(std::atomic<int>& next_row, int horiz, int vert, int row_size,
long double step, long double absc2, long double ordi2,
const unsigned char pal[256][3], unsigned char* image_buffer) {
int b = 0;
while ((b = next_row.fetch_add(1, std::memory_order_relaxed)) < vert) {
int nn = b << 3;
unsigned char* row_ptr = image_buffer + (b * row_size);
for (int a = 0; a < horiz; ++a) {
int mm = a << 3;
long long z[3] = {0, 0, 0};
for (int j = 0; j < 8; ++j) {
long double n = ordi2 + static_cast<long double>(nn + j) * step;
for (int i = 0; i < 8; ++i) {
long double m = absc2 + static_cast<long double>(mm + i) * step;
long double c = m;
long double d = n;
int t = 50000;
long double cc = c * c;
long double dd = d * d;
while (t > 0 && (cc + dd <= 1000000.0L)) {
long double cd = c * d;
d = cd + cd + n;
c = cc - dd + m;
cc = c * c;
dd = d * d;
--t;
}
int remaining = t;
const uint8_t colorIndex = (remaining == 0) ? 255 : static_cast<uint8_t>(remaining % 255);
const int paletteIndex = (colorIndex == 255) ? 255 : (colorIndex - PALETTE + 255) % 255;
z[0] += pal[paletteIndex][0];
z[1] += pal[paletteIndex][1];
z[2] += pal[paletteIndex][2];
}
}
row_ptr[a * 3 + 0] = static_cast<uint8_t>(z[0] >> 6);
row_ptr[a * 3 + 1] = static_cast<uint8_t>(z[1] >> 6);
row_ptr[a * 3 + 2] = static_cast<uint8_t>(z[2] >> 6);
}
}
}
int main() {
int row_size = horiz * 3;
if (row_size % 4 != 0) {
row_size = (row_size + 4) & 0xFFFFFFFC;
}
int pixel_data_size = row_size * vert;
int file_size = pixel_data_size + 54;
int h[14] = {
0x4D42, file_size, 0, 54, 40, horiz, vert,
0x180001, 0, pixel_data_size, 2834, 2834, 0, 0
};
unsigned char pal[256][3];
const long double pi = std::acosl(-1.0L);
for (int a = 0; a < 255; ++a) {
pal[a][0] = static_cast<unsigned char>(std::round(127 + 127 * std::cosl(2 * pi * a / 255.0L)));
pal[a][1] = static_cast<unsigned char>(std::round(127 + 127 * std::sinl(2 * pi * a / 255.0L)));
pal[a][2] = static_cast<unsigned char>((a % 5) * 63);
}
for (int a = 0; a < 3; ++a) {
pal[255][a] = 255;
}
long double step = size_val / static_cast<long double>(horiz << 3);
long double absc2 = absc - step * static_cast<long double>((horiz << 3) - 1) / 2.0L;
long double ordi2 = ordi - step * static_cast<long double>((vert << 3) - 1) / 2.0L;
std::vector<unsigned char> image_buffer(pixel_data_size, 0);
std::atomic<int> next_row(0);
unsigned int num_threads = std::thread::hardware_concurrency();
if (num_threads == 0) num_threads = 4;
std::cout << "Rendering using " << num_threads << " 80-bit optimized dynamic threads..." << std::endl;
std::vector<std::thread> threads;
threads.reserve(num_threads);
for (unsigned int t = 0; t < num_threads; ++t) {
threads.emplace_back(worker_thread, std::ref(next_row), horiz, vert, row_size,
step, absc2, ordi2, pal, image_buffer.data());
}
while (true) {
int current_row = next_row.load(std::memory_order_relaxed);
if (current_row >= vert) {
std::cout << "Done: " << vert << "/" << vert << " (100%)\r" << std::flush;
break;
}
std::cout << "Done: " << current_row << "/" << vert
<< " (" << (current_row * 100 / vert) << "%)\r" << std::flush;
std::this_thread::sleep_for(std::chrono::milliseconds(100));
}
for (auto& thread : threads) {
if (thread.joinable()) {
thread.join();
}
}
std::ofstream f("Mandelbrot Set Image 31.bmp", std::ios::binary);
if (!f.is_open()) {
std::cerr << "Error creating file!" << std::endl;
return 1;
}
f.write(reinterpret_cast<const char*>(&h), 2);
f.write(reinterpret_cast<const char*>(&h[1]), 52);
f.write(reinterpret_cast<const char*>(image_buffer.data()), pixel_data_size);
f.close();
std::cout << "\nFinished! File saved as Mandelbrot Set Image 31.bmp" << std::endl;
return 0;
}
Gallery of created fractals
Deep zoom videos
-
Fragment 1 (Zoom to 10−119)
-
Fragment 2 (Zoom to 10−57)
-
Fragment 3 (Zoom to 10−69)
Color cycling GIF animations
Static color cycling animation (Palette shifting)
Images rendered using perturbation theory and bilinear approximation
Images at zoom scales not exceeding 10−19 (80-bit precision limit)
Lizenz
| Diese Datei wird unter der Creative-Commons-Lizenz CC0 1.0 Verzicht auf das Copyright zur Verfügung gestellt. | |
| Die Person, die das Werk mit diesem Dokument verbunden hat, übergibt dieses weltweit der Gemeinfreiheit, indem sie alle Urheberrechte und damit verbundenen weiteren Rechte – im Rahmen der jeweils geltenden gesetzlichen Bestimmungen – aufgibt. Das Werk kann – selbst für kommerzielle Zwecke – kopiert, modifiziert und weiterverteilt werden, ohne hierfür um Erlaubnis bitten zu müssen.
http://creativecommons.org/publicdomain/zero/1.0/deed.enCC0Creative Commons Zero, Public Domain Dedicationfalsefalse |
Dieses Bild wurde unter Berücksichtigung der Leitlinie für Qualitätsbilder bewertet und gilt als Qualitätsbild.
العربية ∙ جازايرية ∙ беларуская ∙ беларуская (тарашкевіца) ∙ български ∙ বাংলা ∙ català ∙ čeština ∙ Cymraeg ∙ Deutsch ∙ Schweizer Hochdeutsch ∙ Zazaki ∙ Ελληνικά ∙ English ∙ Esperanto ∙ español ∙ eesti ∙ euskara ∙ فارسی ∙ suomi ∙ français ∙ galego ∙ עברית ∙ हिन्दी ∙ hrvatski ∙ magyar ∙ հայերեն ∙ Bahasa Indonesia ∙ italiano ∙ 日本語 ∙ Jawa ∙ ქართული ∙ Qaraqalpaqsha ∙ 한국어 ∙ kurdî ∙ кыргызча ∙ Latina ∙ Lëtzebuergesch ∙ lietuvių ∙ македонски ∙ മലയാളം ∙ मराठी ∙ Bahasa Melayu ∙ Nederlands ∙ ਪੰਜਾਬੀ ∙ Norfuk / Pitkern ∙ polski ∙ português ∙ português do Brasil ∙ rumantsch ∙ română ∙ русский ∙ sicilianu ∙ slovenčina ∙ slovenščina ∙ shqip ∙ српски / srpski ∙ svenska ∙ தமிழ் ∙ తెలుగు ∙ ไทย ∙ Tagalog ∙ toki pona ∙ Türkçe ∙ українська ∙ oʻzbekcha / ўзбекча ∙ vèneto ∙ Tiếng Việt ∙ 中文 ∙ 中文(简体) ∙ 中文(繁體) ∙ +/− |
Kurzbeschreibungen
In dieser Datei abgebildete Objekte
Motiv
Einige Werte ohne einen Wikidata-Eintrag
7. Juli 2025
Dateiversionen
Klicke auf einen Zeitpunkt, um diese Version zu laden.
| Version vom | Vorschaubild | Maße | Benutzer | Kommentar | |
|---|---|---|---|---|---|
| aktuell | 11:31, 25. Nov. 2026 | 10.800 × 10.800 (182,29 MB) | wikimediacommons>Aokoroko | Increased resolution |
Dateiverwendung
Keine Seite verwendet diese Datei.