fractals

Multithreading computation of Mandelbrot set

梦想的初衷 提交于 2021-02-06 14:00:16
问题 I have created a program which creates a Mandelbrot set. Now I'm trying to make it multithreaded. // mandelbrot.cpp // compile with: g++ -std=c++11 mandelbrot.cpp -o mandelbrot // view output with: eog mandelbrot.ppm #include <fstream> #include <complex> // if you make use of complex number facilities in C++ #include <iostream> #include <cstdlib> #include <thread> #include <mutex> #include <vector> using namespace std; template <class T> struct RGB { T r, g, b; }; template <class T> class

Multithreading computation of Mandelbrot set

这一生的挚爱 提交于 2021-02-06 13:59:01
问题 I have created a program which creates a Mandelbrot set. Now I'm trying to make it multithreaded. // mandelbrot.cpp // compile with: g++ -std=c++11 mandelbrot.cpp -o mandelbrot // view output with: eog mandelbrot.ppm #include <fstream> #include <complex> // if you make use of complex number facilities in C++ #include <iostream> #include <cstdlib> #include <thread> #include <mutex> #include <vector> using namespace std; template <class T> struct RGB { T r, g, b; }; template <class T> class

How to adjust panning while zooming

无人久伴 提交于 2020-05-14 09:13:10
问题 I want to pan while zooming into a Mandelbrot set so that the fractal portion of the function stays within the window. The code outputs a series of png images to later be made into a video. Right now, I have the zooming and panning working but I do not know how to adjust the panning while the function is zooming. import numpy as np import matplotlib.pyplot as plt from os import path #6:36 @2560x1440 500 iter #2:51 @2560x1440 200 iter #0:56 @2560x1440 50 iter #1:35 @2560x1440 100 iter #0:53

How to adjust panning while zooming

南笙酒味 提交于 2020-05-14 09:11:50
问题 I want to pan while zooming into a Mandelbrot set so that the fractal portion of the function stays within the window. The code outputs a series of png images to later be made into a video. Right now, I have the zooming and panning working but I do not know how to adjust the panning while the function is zooming. import numpy as np import matplotlib.pyplot as plt from os import path #6:36 @2560x1440 500 iter #2:51 @2560x1440 200 iter #0:56 @2560x1440 50 iter #1:35 @2560x1440 100 iter #0:53

How to adjust panning while zooming

对着背影说爱祢 提交于 2020-05-14 09:11:31
问题 I want to pan while zooming into a Mandelbrot set so that the fractal portion of the function stays within the window. The code outputs a series of png images to later be made into a video. Right now, I have the zooming and panning working but I do not know how to adjust the panning while the function is zooming. import numpy as np import matplotlib.pyplot as plt from os import path #6:36 @2560x1440 500 iter #2:51 @2560x1440 200 iter #0:56 @2560x1440 50 iter #1:35 @2560x1440 100 iter #0:53

Hilbert curve using turtle graphics and recursion

杀马特。学长 韩版系。学妹 提交于 2020-01-25 11:15:06
问题 I'm trying to implement an L-System generated Hilbert curve ,making use of python turtle graphics and recursion. My code seems to be working for the first two levels of recursion n=1 and n=2 but beyond that , the graphics just entangled (although I´m able to observe further modules within them), and I can´t seem to grasp what might be wrong here, do I need some intermediate steps to regenerate the Hilbert modules for deeper levels of recursion? Please see my code below , its relatively simple

2D cache-friendly data structures and space-filling curves

╄→гoц情女王★ 提交于 2020-01-23 16:45:48
问题 I've read that space-filling curves such as the Peano curve are useful for maintaining cache-friendly data structures in a linear address space, since they maintain physical spatial locality. However, I'm not sure how to actually use them. Do any of these curves have formulas for quickly translating a linear address into (x,y) coordinates and vice-versa? Otherwise, how do I determine where in memory to look when looking up a certain pair of coordinates? An example would be very helpful. 回答1:

Smooth spectrum for Mandelbrot Set rendering

限于喜欢 提交于 2019-12-27 17:01:05
问题 I'm currently writing a program to generate really enormous (65536x65536 pixels and above) Mandelbrot images, and I'd like to devise a spectrum and coloring scheme that does them justice. The wikipedia featured mandelbrot image seems like an excellent example, especially how the palette remains varied at all zoom levels of the sequence. I'm not sure if it's rotating the palette or doing some other trick to achieve this, though. I'm familiar with the smooth coloring algorithm for the

How can I make this fractal render faster in Zelle graphics?

泄露秘密 提交于 2019-12-24 00:48:15
问题 This takes over an hour to render this mandelbrot set with only 100 iteration and has taken 10 hours with 10,000 iterations. Is there a way to make it faster: from graphics import * width = 700 height = 700 win = GraphWin("Mandelbrot",width,height) spacing = 1 zoom = 0.1 xOffset = -0.171 yOffset = 0.61 win.setBackground('black') for x in range(0,width,spacing): for y in range(1,height,spacing): a = ((x / width) * zoom) - xOffset b = ((y / height) * zoom) - yOffset pt = Point(x,y) n = 0 ca = a