Based on a post made on reddit.com/rGenerates an image based on the occurrence of prime numbers in the spectrum of natural numbers/dataisbeautiful this programm generates the prime numbers up to a spciefied amount to then generate an imaged based on these numbers. Each time a prime number is encountered, while counting up the natural numbers a line drawn will make a 90° turn. For each iteration the line moves foward by one pixel.
So one might ask: "What is the difference to the original primeNumberImage project?" Well, did you ever think "Gee, my computer is doing some pretty cool stuff right now and still the task is over quickly? Isn't there something that slows things down to make the process feel better? This is exactly what this project offers! The code uses a so called "useless factor". This factor can be set as high or low as you like, which then influences the time the program takes to complete the task.
Into the folder of this repository clone the EasyBMP repository:
https://github.com/izanbf1803/EasyBMP
This library is used to generate the image
By default the programm will generate a 2000 x 2000 image with the origin point of the line in the center of the image. As well as generating the primes in the range from 2 to 200000. This is enough for the line to reach the border of the image
The user can change several parameters to get the image just the way they want to.
- Range for the primes to be generated in
- Size of the image
- Starting direction of the line
- Starting position of the line
Depending on whether the line is supposed to reach the border of the image, either the size or the amount of primes generated can be adjusted. As long as there are still more generated primes available and the border hasn't been reached the line will proceed to be drawn.