Skip to content

ubavic/p-adic-diagrams

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

p-adic-diagrams

This simple program creates diagrams of p-adic integers. All configuration is done in the source file src/Main.hs. Program is conceived as most hackable as possible.

Building

Bulid with cabal by running cabal build (or cabal new-build) inside repo.

Usage

Run p-adic-diagrams -o OUTPUT -w WIDTH P DEPTH, where P and DEPTH are positive integers, WIDTH is desired width of the output image and OUTPUT is name of output file. All parametars are mandatory.

Example

Following comand generate 1000x1000 diagram of Z5 with 4 levels.

p-adic-diagrams -o Z5.png -w 1000 5 4

Z5 colored red

SVG output

See comment on line 11 in Main.hs.

Examples

Z3 colored red Z7 colored green Z2

First image is the original output of this script. Second one has a slight gap between circles (this is obtained by adding # scale 0.9 to appropriate place in the pAdic functiion). Third image is obtained by changing a few lines of code. It is easy to make adjusments like this by simple modification of code.

Credits

Author of program is Nikola Ubavić.

License

See the LICENSE file for details.