Skip to content

Generates an image based on the occurrence of prime numbers in the spectrum of natural numbers

License

Notifications You must be signed in to change notification settings

JustM3dium/primeNumberImage

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

primeNumberImage

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.

Difference

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.

Installation

Into the folder of this repository clone the EasyBMP repository:

https://github.com/izanbf1803/EasyBMP

This library is used to generate the image

Default case

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

How to use

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.

Examples

Default

  • n = 200000
  • width = 2000
  • x,y = width/2
  • direction = 1
  • useless factor values = 3, 3

Less primes

  • n = 100000
  • width = 2000
  • x,y = width/2
  • direction = 1

Change in origin

  • n = 100000
  • width = 2000
  • x = 200
  • y = 1600
  • direction = 1

Change in direction

  • n = 100000
  • width = 2000
  • x = 200
  • y = 1600
  • direction = 2

About

Generates an image based on the occurrence of prime numbers in the spectrum of natural numbers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 100.0%