alexander-0x80 / beauty-of-roots Goto Github PK
View Code? Open in Web Editor NEWPolynomial roots fractal generator
License: The Unlicense
Polynomial roots fractal generator
License: The Unlicense
Hi Alexander: thanks for your code.
I run roots.py on my computer and when the degree is larger than 20 it got very slow. for degree >= 22 it's expected to run a whole day.
I saw you used a list and append the roots to it, and list will get reallocated many times, I think this is the bottleneck in the performance.
May be you should declare a numpy array of size degree * 2**degree, and assign roots to this array. It runs much faster on my computer (45mins for d=22)
Another tip: when assigning HSV colors to the img, you used two for loops and this can be simplified further. np.where( Z > 0) would find the elements in Z that are >0, and then one can do vectorized arithmetic on Z then. the hsv_to_rgb() function in colorsys does not support vectorized arithmetic, but the function with the same name in matplotlib.colors does, and the color map "afmhot" does exactly the coloring scheme you did in plot.py.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.