Skip to content

vawale/primes_polar_plot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Plotting prime numbers

Explore plotting prime numbers in polar coordinates. Inspired by: Why do prime numbers make these spirals? and concept of primes as figure or ground introduced in Godel, Escher, and Bach.

Uses plotting library matplotplusplus.

Setup requirements

  • CMake version 3.20 or higher
  • C++ compiler that supports C++20
  • clang-format for formatting files

Configure and build project

Example using clang++ compiler. Replace clang++ with g++ if using gcc.

mkdir build
cmake -S .. -B . -DCMAKE_CXX_COMPILER=clang++ -DWARNINGS=ON -DWARNINGS_AS_ERRORS=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
cmake --build . -j12

Buildtime dependencies

Needs matplotplusplus library for build. The latest master branch of matplotplusplus is downloaded and built as part of cmake project.

Runtime dependencies

Install gnuplot. For Fedora:

sudo dnf install -y gnuplot

Formatting files

clang-format ../src/*.hpp -i
clang-format ../src/*.cpp -i

Example plot

Polar plot of points (x,x) of all natural numbers x between 1-10000: alt text

Polar plot of points (x,x) of all prime numbers x between 1-10000: alt text

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published