figurate_numbers 1.5.0 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +100 -0
- data/lib/figurate_numbers/version.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 615bd4bfc8ce65a4075fb7b9456ed793e8bedaa3157a6875accdd59f86b592ec
|
4
|
+
data.tar.gz: 4f3f33115e5c40912b0730be116757ff0211703e89e2e0b27315d35f276283ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c097387a659972438771724497a87c1bcd28f1a6714fa619d97dc7bd2dda137ae4f0531745834637423ae1da6d3588482ff0cefe2d9da203968e63477cdb723
|
7
|
+
data.tar.gz: d483f180c9aea3c43520301fca605c8118be359e47b73e2817f2cae9afe2733b375ca3f78ab551cc3be276f8e30953b1e3585163064b2ebbd3b510cd245f2536
|
data/README.md
ADDED
@@ -0,0 +1,100 @@
|
|
1
|
+
<h1 align="center"> Figurate Numbers </h1>
|
2
|
+
|
3
|
+
**Figurate Numbers** is the most comprehensive and specialized library for figurate numbers, developed in Ruby to date.
|
4
|
+
It implements **241 infinite number sequences** inspired by the groundbreaking work [*Figurate Numbers*](https://books.google.com.pe/books/about/Figurate_Numbers.html?id=ERS7CgAAQBAJ&redir_esc=y) by Elena Deza and Michel Deza, published in 2012.
|
5
|
+
|
6
|
+
<p align="center">
|
7
|
+
<img src="https://img.shields.io/gem/v/figurate_numbers" alt="Gem Version">
|
8
|
+
<img src="https://img.shields.io/gem/dt/figurate_numbers" alt="Gem Total Downloads">
|
9
|
+
<img src="https://img.shields.io/github/stars/edelveart/figurate_numbers" alt="GitHub Repo stars">
|
10
|
+
<img src="https://img.shields.io/github/license/edelveart/figurate_numbers" alt="GitHub License">
|
11
|
+
</p>
|
12
|
+
|
13
|
+
[](https://rubygems.org/gems/figurate_numbers)
|
14
|
+
|
15
|
+
|
16
|
+
## 💎 Installation
|
17
|
+
|
18
|
+
Install it from the gem repository:
|
19
|
+
|
20
|
+
```rb
|
21
|
+
gem install figurate_numbers
|
22
|
+
```
|
23
|
+
|
24
|
+
## 🧊 Features
|
25
|
+
|
26
|
+
Figurate Numbers implements 241 infinite sequences using the Enumerator class in Ruby, each categorized by its geometric dimension. It is ideal for use in mathematical modeling, algorithmic composition, and integration with tools like Sonic Pi.
|
27
|
+
|
28
|
+
The sequences are organized following the structure of the *Figurate Numbers* book:
|
29
|
+
|
30
|
+
- 🟦 **PlaneFigurateNumbers**: 79 sequences (2D)
|
31
|
+
- 🟥 **SpaceFigurateNumbers**: 86 sequences (3D)
|
32
|
+
- 🟨 **MultiDimensionalFigurateNumbers**: 70 sequences (4D and beyond)
|
33
|
+
- 🧬 **Zoo of figurate-related numbers**: 6 additional sequences *(included in the MultiDimensional module)*
|
34
|
+
- ⚙️ **ArithTransform**: p-adic transformations and other arithmetic operations
|
35
|
+
|
36
|
+
|
37
|
+
## 🧰 How to use in Ruby
|
38
|
+
|
39
|
+
### Version 1.5.0
|
40
|
+
|
41
|
+
```rb
|
42
|
+
require 'figurate_numbers'
|
43
|
+
|
44
|
+
## Using take(integer)
|
45
|
+
FigurateNumbers.pentatope.take(10)
|
46
|
+
|
47
|
+
## Storing and iterating
|
48
|
+
f = FigurateNumbers.centered_octagonal_pyramid
|
49
|
+
f.next
|
50
|
+
f.next
|
51
|
+
f.next
|
52
|
+
```
|
53
|
+
Starting from version **1.5.0**, `figurate_numbers` not only supports global access via `FigurateNumbers` and the use of specific classes for separate access, but also introduces new p-adic transformations and other mathematical operations that can be applied directly to sequences.
|
54
|
+
|
55
|
+
```rb
|
56
|
+
PlaneFigurateNumbers.polygonal(19)
|
57
|
+
SpaceFigurateNumbers.rhombic_dodecahedral
|
58
|
+
MultiDimensionalFigurateNumbers.six_dimensional_hyperoctahedron
|
59
|
+
seq = MultiDimensionalFigurateNumbers.five_dimensional_hypercube.take(15)
|
60
|
+
ArithTransform.ring_padic_val(seq, 3)
|
61
|
+
```
|
62
|
+
> 📚 Explore the detailed list of figurate numbers and arithmetic transformations [here 🔍.](https://github.com/edelveart/figurate_numbers/blob/main/docs/METHODS.md)
|
63
|
+
|
64
|
+
## 🎶 How to use in Sonic Pi
|
65
|
+
|
66
|
+
Simply copy the entry point path from the `lib/figurate_numbers.rb` file where the *gem* is installed.
|
67
|
+
|
68
|
+
```rb
|
69
|
+
require "<PATH>"
|
70
|
+
|
71
|
+
pol_num = FigurateNumbers.polygonal(8)
|
72
|
+
350.times do
|
73
|
+
play pol_num.next % 12 * 7 # Some mathematical function or transformation
|
74
|
+
sleep 0.125
|
75
|
+
end
|
76
|
+
|
77
|
+
amp_seq = SpaceFigurateNumbers.centered_hendecagonal_pyramidal
|
78
|
+
100.times do
|
79
|
+
sample :bd_sone, amp: ArithTransform.padic_norm(amp_seq.next, 3) # p-adic amplitude control
|
80
|
+
sleep 0.25
|
81
|
+
end
|
82
|
+
```
|
83
|
+
|
84
|
+
### Version 1.3.0 (legacy)
|
85
|
+
|
86
|
+
The main change introduced after version **1.3.0** is that you must now import the file using **require** instead of **run_file**; otherwise, it will not function.
|
87
|
+
|
88
|
+
See discussion in the [**Sonic Pi community thread right here!**](https://in-thread.sonic-pi.net/t/figurate-numbers-for-sonic-pi-new-ruby-gem-for-infinite-number-sequences-and-patterns/8962)
|
89
|
+
|
90
|
+
## 📚 List of Sequences in `figurate_numbers` and Arithmetic Transformations Methods
|
91
|
+
|
92
|
+
Explore the complete list of figurate number sequences:
|
93
|
+
|
94
|
+
- [View all implemented methods and sequences 🔍](https://github.com/edelveart/figurate_numbers/blob/main/docs/METHODS.md)
|
95
|
+
|
96
|
+
## 📝 Book Errata
|
97
|
+
|
98
|
+
Corrections to formulas and data found in *Figurate Numbers* (2012):
|
99
|
+
|
100
|
+
- [See full list of known errata 🔍](https://github.com/edelveart/figurate_numbers/blob/main/docs/ERRATA.md)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: figurate_numbers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Edgar Armando Delgado Vega
|
@@ -18,11 +18,13 @@ email:
|
|
18
18
|
executables: []
|
19
19
|
extensions: []
|
20
20
|
extra_rdoc_files:
|
21
|
-
-
|
21
|
+
- LICENSE
|
22
|
+
- README.md
|
22
23
|
- docs/ERRATA.md
|
23
24
|
- docs/METHODS.md
|
24
25
|
files:
|
25
|
-
-
|
26
|
+
- LICENSE
|
27
|
+
- README.md
|
26
28
|
- docs/ERRATA.md
|
27
29
|
- docs/METHODS.md
|
28
30
|
- lib/figurate_numbers.rb
|