AxiomX 0.1.0.dev8__tar.gz → 0.1.1__tar.gz
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.
- axiomx-0.1.1/AxiomX/calculus.py +95 -0
- {axiomx-0.1.0.dev8 → axiomx-0.1.1}/AxiomX/constants.py +3 -1
- {axiomx-0.1.0.dev8 → axiomx-0.1.1}/AxiomX/exp.py +1 -1
- {axiomx-0.1.0.dev8 → axiomx-0.1.1}/AxiomX/functions.py +19 -1
- {axiomx-0.1.0.dev8 → axiomx-0.1.1}/AxiomX/trig.py +17 -1
- axiomx-0.1.1/AxiomX.egg-info/PKG-INFO +118 -0
- axiomx-0.1.1/PKG-INFO +118 -0
- axiomx-0.1.1/README.md +106 -0
- {axiomx-0.1.0.dev8 → axiomx-0.1.1}/pyproject.toml +1 -1
- {axiomx-0.1.0.dev8 → axiomx-0.1.1}/setup.py +1 -1
- axiomx-0.1.0.dev8/AxiomX/calculus.py +0 -60
- axiomx-0.1.0.dev8/AxiomX.egg-info/PKG-INFO +0 -18
- axiomx-0.1.0.dev8/PKG-INFO +0 -18
- axiomx-0.1.0.dev8/README.md +0 -6
- {axiomx-0.1.0.dev8 → axiomx-0.1.1}/AxiomX/__init__.py +0 -0
- {axiomx-0.1.0.dev8 → axiomx-0.1.1}/AxiomX/hyperbolic.py +0 -0
- {axiomx-0.1.0.dev8 → axiomx-0.1.1}/AxiomX.egg-info/SOURCES.txt +0 -0
- {axiomx-0.1.0.dev8 → axiomx-0.1.1}/AxiomX.egg-info/dependency_links.txt +0 -0
- {axiomx-0.1.0.dev8 → axiomx-0.1.1}/AxiomX.egg-info/top_level.txt +0 -0
- {axiomx-0.1.0.dev8 → axiomx-0.1.1}/LICENSE +0 -0
- {axiomx-0.1.0.dev8 → axiomx-0.1.1}/setup.cfg +0 -0
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# integrating integrals
|
|
2
|
+
def integrate(function, lowlim, uplim, n=10000):
|
|
3
|
+
h = (uplim - lowlim) / n
|
|
4
|
+
s = function(lowlim) + function(uplim)
|
|
5
|
+
|
|
6
|
+
for i in range(1, n):
|
|
7
|
+
x = lowlim + i * h
|
|
8
|
+
if i % 2 == 0:
|
|
9
|
+
s += 2 * function(x)
|
|
10
|
+
else:
|
|
11
|
+
s += 4 * function(x)
|
|
12
|
+
|
|
13
|
+
return s * h / 3
|
|
14
|
+
|
|
15
|
+
def summation(lowlim, uplim, function, max_terms=10**6):
|
|
16
|
+
total = 0
|
|
17
|
+
count = 0
|
|
18
|
+
|
|
19
|
+
if uplim == float("inf"):
|
|
20
|
+
n = lowlim
|
|
21
|
+
while count < max_terms:
|
|
22
|
+
try:
|
|
23
|
+
term = function(n)
|
|
24
|
+
except ZeroDivisionError:
|
|
25
|
+
n += 1
|
|
26
|
+
continue
|
|
27
|
+
|
|
28
|
+
total += term
|
|
29
|
+
|
|
30
|
+
# Stop if terms are negligible
|
|
31
|
+
if abs(term) < 1e-10:
|
|
32
|
+
break
|
|
33
|
+
|
|
34
|
+
n += 1
|
|
35
|
+
count += 1
|
|
36
|
+
|
|
37
|
+
return total
|
|
38
|
+
|
|
39
|
+
else:
|
|
40
|
+
for n in range(int(lowlim), int(uplim) + 1):
|
|
41
|
+
total += function(n)
|
|
42
|
+
return total
|
|
43
|
+
|
|
44
|
+
def converges(f, tolerance=1e-6, max_terms=10**6):
|
|
45
|
+
total = 0
|
|
46
|
+
prev = 0
|
|
47
|
+
|
|
48
|
+
for n in range(1, max_terms):
|
|
49
|
+
try:
|
|
50
|
+
total += f(n)
|
|
51
|
+
except ZeroDivisionError:
|
|
52
|
+
continue
|
|
53
|
+
|
|
54
|
+
# Check if partial sum stabilizes
|
|
55
|
+
if abs(total - prev) < tolerance:
|
|
56
|
+
return True
|
|
57
|
+
|
|
58
|
+
prev = total
|
|
59
|
+
|
|
60
|
+
return False
|
|
61
|
+
|
|
62
|
+
def lim(f, xlim, tol=1e-5):
|
|
63
|
+
# Try direct substitution
|
|
64
|
+
try:
|
|
65
|
+
return f(xlim)
|
|
66
|
+
except ZeroDivisionError:
|
|
67
|
+
pass # expected for limits
|
|
68
|
+
except Exception as e:
|
|
69
|
+
return None # or raise e if you want strict behavior
|
|
70
|
+
|
|
71
|
+
hs = [1e-1, 1e-2, 1e-3, 1e-4, 1e-5]
|
|
72
|
+
left_vals = []
|
|
73
|
+
right_vals = []
|
|
74
|
+
|
|
75
|
+
for h in hs:
|
|
76
|
+
try:
|
|
77
|
+
left_vals.append(f(xlim - h))
|
|
78
|
+
except ZeroDivisionError:
|
|
79
|
+
continue
|
|
80
|
+
|
|
81
|
+
try:
|
|
82
|
+
right_vals.append(f(xlim + h))
|
|
83
|
+
except ZeroDivisionError:
|
|
84
|
+
continue
|
|
85
|
+
|
|
86
|
+
if not left_vals or not right_vals:
|
|
87
|
+
return None
|
|
88
|
+
|
|
89
|
+
left = left_vals[-1]
|
|
90
|
+
right = right_vals[-1]
|
|
91
|
+
|
|
92
|
+
if abs(left - right) < tol:
|
|
93
|
+
return (left + right) / 2
|
|
94
|
+
|
|
95
|
+
return None
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
pi = 3.141592653589793
|
|
2
2
|
e = 2.718281828459045
|
|
3
|
-
|
|
3
|
+
tau = 2*pi
|
|
4
|
+
lemniscate = 2.622057554292119
|
|
4
5
|
gauss = lemniscate / pi
|
|
5
6
|
euler_mascheroni = 0.577215664901533
|
|
6
7
|
sqrt_2 = 2**0.5
|
|
@@ -10,6 +11,7 @@ golden_ratio = (1 + sqrt_5) / 2
|
|
|
10
11
|
silver_ratio = 1 + sqrt_2
|
|
11
12
|
gelfond = e**pi
|
|
12
13
|
gelfond_schneider = 2**sqrt_2
|
|
14
|
+
infinity = float("inf")
|
|
13
15
|
|
|
14
16
|
def metallic_ratio(n):
|
|
15
17
|
return (n + (n**2 + 4)**0.5) / 2
|
|
@@ -85,4 +85,22 @@ def beta(n):
|
|
|
85
85
|
total = 0.0
|
|
86
86
|
for i in range(100000):
|
|
87
87
|
total += ((-1)**i) / ((2*i + 1)**n)
|
|
88
|
-
return total
|
|
88
|
+
return total
|
|
89
|
+
|
|
90
|
+
def bc(n, k):
|
|
91
|
+
if k < 0 or k > n:
|
|
92
|
+
raise ValueError("Binomial coefficient (n k) doesn't work for negative n or k, or if n < k")
|
|
93
|
+
|
|
94
|
+
k = min(k, n - k) # symmetry optimization
|
|
95
|
+
result = 1
|
|
96
|
+
|
|
97
|
+
for i in range(1, k + 1):
|
|
98
|
+
result = result * (n - i + 1) // i
|
|
99
|
+
|
|
100
|
+
return result
|
|
101
|
+
|
|
102
|
+
def pascal(row):
|
|
103
|
+
pr = []
|
|
104
|
+
for i in range(0, row+1):
|
|
105
|
+
pr.append(int(bc(row, i)))
|
|
106
|
+
return pr
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
from AxiomX.constants import *
|
|
2
|
+
from AxiomX.functions import *
|
|
3
|
+
|
|
1
4
|
def radians(deg):
|
|
2
5
|
return (pi/180)*deg
|
|
3
6
|
|
|
@@ -18,7 +21,6 @@ def sin(x, terms=20):
|
|
|
18
21
|
for n in range(terms):
|
|
19
22
|
term = ((-1)**n) * (x**(2*n + 1)) / factorial(2*n + 1)
|
|
20
23
|
sine_value += term
|
|
21
|
-
return sine_value
|
|
22
24
|
if quarter == 1:
|
|
23
25
|
return sine_value
|
|
24
26
|
elif quarter == 2:
|
|
@@ -32,15 +34,23 @@ def cos(x):
|
|
|
32
34
|
return sin((pi/2)-x)
|
|
33
35
|
|
|
34
36
|
def tan(x):
|
|
37
|
+
if cos(x) == 0:
|
|
38
|
+
return float("inf")
|
|
35
39
|
return sin(x) / cos(x)
|
|
36
40
|
|
|
37
41
|
def cot(x):
|
|
42
|
+
if tan(x) == 0:
|
|
43
|
+
return float("inf")
|
|
38
44
|
return 1 / tan(x)
|
|
39
45
|
|
|
40
46
|
def sec(x):
|
|
47
|
+
if cos(x) == 0:
|
|
48
|
+
return float("inf")
|
|
41
49
|
return 1 / cos(x)
|
|
42
50
|
|
|
43
51
|
def cosec(x):
|
|
52
|
+
if sin(x) == 0:
|
|
53
|
+
return float("inf")
|
|
44
54
|
return 1 / sin(x)
|
|
45
55
|
|
|
46
56
|
def arcsin(x, iterations=10):
|
|
@@ -48,6 +58,8 @@ def arcsin(x, iterations=10):
|
|
|
48
58
|
raise ValueError("x must be in [-1, 1]")
|
|
49
59
|
y = x
|
|
50
60
|
for _ in range(iterations):
|
|
61
|
+
if cos(y) == 0:
|
|
62
|
+
break
|
|
51
63
|
y -= (sin(y) - x) / cos(y)
|
|
52
64
|
return y
|
|
53
65
|
|
|
@@ -61,7 +73,11 @@ def arccot(x):
|
|
|
61
73
|
return (pi/2) - arctan(x)
|
|
62
74
|
|
|
63
75
|
def arcsec(x):
|
|
76
|
+
if x < 1:
|
|
77
|
+
raise ValueError("x < 1")
|
|
64
78
|
return arccos(1/x)
|
|
65
79
|
|
|
66
80
|
def arccosec(x):
|
|
81
|
+
if x < 1:
|
|
82
|
+
raise ValueError("x < 1")
|
|
67
83
|
return arcsin(1/x)
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: AxiomX
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: A dynamic Python math library containing numerous mathematical functions implemented from scratch.
|
|
5
|
+
Author: Eric Joseph
|
|
6
|
+
License: MIT
|
|
7
|
+
Requires-Python: >=2.7
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Dynamic: license-file
|
|
11
|
+
Dynamic: requires-python
|
|
12
|
+
|
|
13
|
+
# AxiomX
|
|
14
|
+
|
|
15
|
+
**AxiomX** is a lightweight Python scientific math library focused on numerical computation, series-based evaluation, and foundational mathematical functions.
|
|
16
|
+
It is designed to be simple, fast and extensible—ideal for learning, experimentation, and building advanced math systems.
|
|
17
|
+
* * *
|
|
18
|
+
## 🚀 Features
|
|
19
|
+
|
|
20
|
+
### 📚 Constants (included in `AxiomX.constants`)
|
|
21
|
+
* `pi`
|
|
22
|
+
* `e`
|
|
23
|
+
* lemniscate constant (`lemniscate`)
|
|
24
|
+
* gauss constant (`gauss`)
|
|
25
|
+
* `infinity`
|
|
26
|
+
* square roots of 2, 3 and 5 (`sqrt_2`, `sqrt_3`, `sqrt_5`)
|
|
27
|
+
* golden ratio (`golden_ratio`)
|
|
28
|
+
* silver ratio (`silver_ratio`)
|
|
29
|
+
* `metallic_ratio(n)` - Returns the metallic ratio of the order n.
|
|
30
|
+
* euler-mascheroni constant (`euler_mascheroni`)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
### 🔢 Mathematical Functions (included in `AxiomX.functions`)
|
|
34
|
+
|
|
35
|
+
* `absolute(x)`
|
|
36
|
+
* `sqrt(n)` - using Halley's Method
|
|
37
|
+
* `cbrt(n)` - using Newton-Raphson Method
|
|
38
|
+
* `gamma(x)`
|
|
39
|
+
* `factorial(n)` - using gamma function
|
|
40
|
+
* `zeta(n)` - returns the Riemann Zeta function evaluated at n
|
|
41
|
+
* `beta(n)` - returns the Dirichlet Beta function evaluated at n
|
|
42
|
+
* `bc(n, k)` - returns the binomial coefficient evaluated at n and k
|
|
43
|
+
* `pascal(row)` - returns a list containing all the numbers at the *row*th row in the Pascal Triangle.
|
|
44
|
+
|
|
45
|
+
### 📈 Exponential Functions (included in `AxiomX.exp`)
|
|
46
|
+
|
|
47
|
+
* `exp(n)` - returns e^n, where e is Euler's number.
|
|
48
|
+
* `ln(x)` - returns the natural logarithm of *x*.
|
|
49
|
+
* `log10(x)` - returns the common logarithm of *x*.
|
|
50
|
+
* `log2(x)` - returns the binary logarithm of *x*.
|
|
51
|
+
* `log(arg, base)` - returns the logarithm of *arg* to the base *base*.
|
|
52
|
+
|
|
53
|
+
### 📐 Trigonometric Functions (included in `AxiomX.trig`)
|
|
54
|
+
|
|
55
|
+
- `sin(x)` — Calculated from Taylor series expansion
|
|
56
|
+
- `cos(x)` — derived from sine
|
|
57
|
+
- `tan(x)`, `cot(x)`, `sec(x)`, `cosec(x)`
|
|
58
|
+
- `radians(deg)` — degrees → radians
|
|
59
|
+
- `degrees(rad)` — radians → degrees
|
|
60
|
+
|
|
61
|
+
### 🔄 Inverse Trigonometric Functions (also included in `AxiomX.trig`)
|
|
62
|
+
|
|
63
|
+
- `arcsin(x)` — Newton's method
|
|
64
|
+
- `arccos(x)`
|
|
65
|
+
- `arctan(x)`
|
|
66
|
+
- `arccot(x)`
|
|
67
|
+
- `arcsec(x)`
|
|
68
|
+
- `arccosec(x)`
|
|
69
|
+
|
|
70
|
+
### 🔥 Hyperbolic Functions and Inverse Functions (included in `AxiomX.hyperbolic`)
|
|
71
|
+
|
|
72
|
+
* `sinh(x)` - calculated using formula
|
|
73
|
+
* `cosh(x)`, `tanh(x)`, `sech(x)`, `cosech(x)`, `coth(x)`
|
|
74
|
+
* `arcsinh(x)`, `arccosh(x)`, `arctanh(x)`, `arccoth(x)`, `arcsech(x)`, `arccosech(x)`
|
|
75
|
+
* * *
|
|
76
|
+
## 🧠 Usage
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
from AxiomX import trig, constants, calculus
|
|
80
|
+
|
|
81
|
+
print(trig.sin(constants.pi)) # prints 0
|
|
82
|
+
print(calculus.converges(lambda x: 1 / x)) # prints False
|
|
83
|
+
```
|
|
84
|
+
* * *
|
|
85
|
+
## 🛣️ Roadmap
|
|
86
|
+
|
|
87
|
+
Upcoming improvements:
|
|
88
|
+
* Limit evaluation engine
|
|
89
|
+
* Convergence detection for series
|
|
90
|
+
* Combinatorics utilities, Pascal's Triangle
|
|
91
|
+
* Performance optimizations.
|
|
92
|
+
* * *
|
|
93
|
+
## 🤝 Contributing
|
|
94
|
+
|
|
95
|
+
Contributions are welcome!\You can help by:
|
|
96
|
+
* Reporting bugs in our [Discord](https://discord.com/channels/1484861326324138016/1484861327209140366)
|
|
97
|
+
* Adding suggestions
|
|
98
|
+
* Improving performance.
|
|
99
|
+
* * *
|
|
100
|
+
## 📦 Installation
|
|
101
|
+
|
|
102
|
+
You can install AxiomX by going into the terminal and typing *pip install AxiomX*.
|
|
103
|
+
* * *
|
|
104
|
+
## 📄 License
|
|
105
|
+
|
|
106
|
+
This software is licensed under MIT and no one is supposed to copy code from AxiomX.
|
|
107
|
+
* * *
|
|
108
|
+
## 🌐 Links
|
|
109
|
+
|
|
110
|
+
Website: [https://axiomxpy.wordpress.com](https://axiomxpy.wordpress.com)\
|
|
111
|
+
Discord Invite: [https://discord.gg/CrEf8mDB](https://discord.gg/CrEf8mDB)
|
|
112
|
+
* * *
|
|
113
|
+
|
|
114
|
+
## ⭐ Support
|
|
115
|
+
If you like AxiomX, consider:
|
|
116
|
+
* Sharing it with other friends
|
|
117
|
+
* Using it in your projects
|
|
118
|
+
* * *
|
axiomx-0.1.1/PKG-INFO
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: AxiomX
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: A dynamic Python math library containing numerous mathematical functions implemented from scratch.
|
|
5
|
+
Author: Eric Joseph
|
|
6
|
+
License: MIT
|
|
7
|
+
Requires-Python: >=2.7
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Dynamic: license-file
|
|
11
|
+
Dynamic: requires-python
|
|
12
|
+
|
|
13
|
+
# AxiomX
|
|
14
|
+
|
|
15
|
+
**AxiomX** is a lightweight Python scientific math library focused on numerical computation, series-based evaluation, and foundational mathematical functions.
|
|
16
|
+
It is designed to be simple, fast and extensible—ideal for learning, experimentation, and building advanced math systems.
|
|
17
|
+
* * *
|
|
18
|
+
## 🚀 Features
|
|
19
|
+
|
|
20
|
+
### 📚 Constants (included in `AxiomX.constants`)
|
|
21
|
+
* `pi`
|
|
22
|
+
* `e`
|
|
23
|
+
* lemniscate constant (`lemniscate`)
|
|
24
|
+
* gauss constant (`gauss`)
|
|
25
|
+
* `infinity`
|
|
26
|
+
* square roots of 2, 3 and 5 (`sqrt_2`, `sqrt_3`, `sqrt_5`)
|
|
27
|
+
* golden ratio (`golden_ratio`)
|
|
28
|
+
* silver ratio (`silver_ratio`)
|
|
29
|
+
* `metallic_ratio(n)` - Returns the metallic ratio of the order n.
|
|
30
|
+
* euler-mascheroni constant (`euler_mascheroni`)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
### 🔢 Mathematical Functions (included in `AxiomX.functions`)
|
|
34
|
+
|
|
35
|
+
* `absolute(x)`
|
|
36
|
+
* `sqrt(n)` - using Halley's Method
|
|
37
|
+
* `cbrt(n)` - using Newton-Raphson Method
|
|
38
|
+
* `gamma(x)`
|
|
39
|
+
* `factorial(n)` - using gamma function
|
|
40
|
+
* `zeta(n)` - returns the Riemann Zeta function evaluated at n
|
|
41
|
+
* `beta(n)` - returns the Dirichlet Beta function evaluated at n
|
|
42
|
+
* `bc(n, k)` - returns the binomial coefficient evaluated at n and k
|
|
43
|
+
* `pascal(row)` - returns a list containing all the numbers at the *row*th row in the Pascal Triangle.
|
|
44
|
+
|
|
45
|
+
### 📈 Exponential Functions (included in `AxiomX.exp`)
|
|
46
|
+
|
|
47
|
+
* `exp(n)` - returns e^n, where e is Euler's number.
|
|
48
|
+
* `ln(x)` - returns the natural logarithm of *x*.
|
|
49
|
+
* `log10(x)` - returns the common logarithm of *x*.
|
|
50
|
+
* `log2(x)` - returns the binary logarithm of *x*.
|
|
51
|
+
* `log(arg, base)` - returns the logarithm of *arg* to the base *base*.
|
|
52
|
+
|
|
53
|
+
### 📐 Trigonometric Functions (included in `AxiomX.trig`)
|
|
54
|
+
|
|
55
|
+
- `sin(x)` — Calculated from Taylor series expansion
|
|
56
|
+
- `cos(x)` — derived from sine
|
|
57
|
+
- `tan(x)`, `cot(x)`, `sec(x)`, `cosec(x)`
|
|
58
|
+
- `radians(deg)` — degrees → radians
|
|
59
|
+
- `degrees(rad)` — radians → degrees
|
|
60
|
+
|
|
61
|
+
### 🔄 Inverse Trigonometric Functions (also included in `AxiomX.trig`)
|
|
62
|
+
|
|
63
|
+
- `arcsin(x)` — Newton's method
|
|
64
|
+
- `arccos(x)`
|
|
65
|
+
- `arctan(x)`
|
|
66
|
+
- `arccot(x)`
|
|
67
|
+
- `arcsec(x)`
|
|
68
|
+
- `arccosec(x)`
|
|
69
|
+
|
|
70
|
+
### 🔥 Hyperbolic Functions and Inverse Functions (included in `AxiomX.hyperbolic`)
|
|
71
|
+
|
|
72
|
+
* `sinh(x)` - calculated using formula
|
|
73
|
+
* `cosh(x)`, `tanh(x)`, `sech(x)`, `cosech(x)`, `coth(x)`
|
|
74
|
+
* `arcsinh(x)`, `arccosh(x)`, `arctanh(x)`, `arccoth(x)`, `arcsech(x)`, `arccosech(x)`
|
|
75
|
+
* * *
|
|
76
|
+
## 🧠 Usage
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
from AxiomX import trig, constants, calculus
|
|
80
|
+
|
|
81
|
+
print(trig.sin(constants.pi)) # prints 0
|
|
82
|
+
print(calculus.converges(lambda x: 1 / x)) # prints False
|
|
83
|
+
```
|
|
84
|
+
* * *
|
|
85
|
+
## 🛣️ Roadmap
|
|
86
|
+
|
|
87
|
+
Upcoming improvements:
|
|
88
|
+
* Limit evaluation engine
|
|
89
|
+
* Convergence detection for series
|
|
90
|
+
* Combinatorics utilities, Pascal's Triangle
|
|
91
|
+
* Performance optimizations.
|
|
92
|
+
* * *
|
|
93
|
+
## 🤝 Contributing
|
|
94
|
+
|
|
95
|
+
Contributions are welcome!\You can help by:
|
|
96
|
+
* Reporting bugs in our [Discord](https://discord.com/channels/1484861326324138016/1484861327209140366)
|
|
97
|
+
* Adding suggestions
|
|
98
|
+
* Improving performance.
|
|
99
|
+
* * *
|
|
100
|
+
## 📦 Installation
|
|
101
|
+
|
|
102
|
+
You can install AxiomX by going into the terminal and typing *pip install AxiomX*.
|
|
103
|
+
* * *
|
|
104
|
+
## 📄 License
|
|
105
|
+
|
|
106
|
+
This software is licensed under MIT and no one is supposed to copy code from AxiomX.
|
|
107
|
+
* * *
|
|
108
|
+
## 🌐 Links
|
|
109
|
+
|
|
110
|
+
Website: [https://axiomxpy.wordpress.com](https://axiomxpy.wordpress.com)\
|
|
111
|
+
Discord Invite: [https://discord.gg/CrEf8mDB](https://discord.gg/CrEf8mDB)
|
|
112
|
+
* * *
|
|
113
|
+
|
|
114
|
+
## ⭐ Support
|
|
115
|
+
If you like AxiomX, consider:
|
|
116
|
+
* Sharing it with other friends
|
|
117
|
+
* Using it in your projects
|
|
118
|
+
* * *
|
axiomx-0.1.1/README.md
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# AxiomX
|
|
2
|
+
|
|
3
|
+
**AxiomX** is a lightweight Python scientific math library focused on numerical computation, series-based evaluation, and foundational mathematical functions.
|
|
4
|
+
It is designed to be simple, fast and extensible—ideal for learning, experimentation, and building advanced math systems.
|
|
5
|
+
* * *
|
|
6
|
+
## 🚀 Features
|
|
7
|
+
|
|
8
|
+
### 📚 Constants (included in `AxiomX.constants`)
|
|
9
|
+
* `pi`
|
|
10
|
+
* `e`
|
|
11
|
+
* lemniscate constant (`lemniscate`)
|
|
12
|
+
* gauss constant (`gauss`)
|
|
13
|
+
* `infinity`
|
|
14
|
+
* square roots of 2, 3 and 5 (`sqrt_2`, `sqrt_3`, `sqrt_5`)
|
|
15
|
+
* golden ratio (`golden_ratio`)
|
|
16
|
+
* silver ratio (`silver_ratio`)
|
|
17
|
+
* `metallic_ratio(n)` - Returns the metallic ratio of the order n.
|
|
18
|
+
* euler-mascheroni constant (`euler_mascheroni`)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### 🔢 Mathematical Functions (included in `AxiomX.functions`)
|
|
22
|
+
|
|
23
|
+
* `absolute(x)`
|
|
24
|
+
* `sqrt(n)` - using Halley's Method
|
|
25
|
+
* `cbrt(n)` - using Newton-Raphson Method
|
|
26
|
+
* `gamma(x)`
|
|
27
|
+
* `factorial(n)` - using gamma function
|
|
28
|
+
* `zeta(n)` - returns the Riemann Zeta function evaluated at n
|
|
29
|
+
* `beta(n)` - returns the Dirichlet Beta function evaluated at n
|
|
30
|
+
* `bc(n, k)` - returns the binomial coefficient evaluated at n and k
|
|
31
|
+
* `pascal(row)` - returns a list containing all the numbers at the *row*th row in the Pascal Triangle.
|
|
32
|
+
|
|
33
|
+
### 📈 Exponential Functions (included in `AxiomX.exp`)
|
|
34
|
+
|
|
35
|
+
* `exp(n)` - returns e^n, where e is Euler's number.
|
|
36
|
+
* `ln(x)` - returns the natural logarithm of *x*.
|
|
37
|
+
* `log10(x)` - returns the common logarithm of *x*.
|
|
38
|
+
* `log2(x)` - returns the binary logarithm of *x*.
|
|
39
|
+
* `log(arg, base)` - returns the logarithm of *arg* to the base *base*.
|
|
40
|
+
|
|
41
|
+
### 📐 Trigonometric Functions (included in `AxiomX.trig`)
|
|
42
|
+
|
|
43
|
+
- `sin(x)` — Calculated from Taylor series expansion
|
|
44
|
+
- `cos(x)` — derived from sine
|
|
45
|
+
- `tan(x)`, `cot(x)`, `sec(x)`, `cosec(x)`
|
|
46
|
+
- `radians(deg)` — degrees → radians
|
|
47
|
+
- `degrees(rad)` — radians → degrees
|
|
48
|
+
|
|
49
|
+
### 🔄 Inverse Trigonometric Functions (also included in `AxiomX.trig`)
|
|
50
|
+
|
|
51
|
+
- `arcsin(x)` — Newton's method
|
|
52
|
+
- `arccos(x)`
|
|
53
|
+
- `arctan(x)`
|
|
54
|
+
- `arccot(x)`
|
|
55
|
+
- `arcsec(x)`
|
|
56
|
+
- `arccosec(x)`
|
|
57
|
+
|
|
58
|
+
### 🔥 Hyperbolic Functions and Inverse Functions (included in `AxiomX.hyperbolic`)
|
|
59
|
+
|
|
60
|
+
* `sinh(x)` - calculated using formula
|
|
61
|
+
* `cosh(x)`, `tanh(x)`, `sech(x)`, `cosech(x)`, `coth(x)`
|
|
62
|
+
* `arcsinh(x)`, `arccosh(x)`, `arctanh(x)`, `arccoth(x)`, `arcsech(x)`, `arccosech(x)`
|
|
63
|
+
* * *
|
|
64
|
+
## 🧠 Usage
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
from AxiomX import trig, constants, calculus
|
|
68
|
+
|
|
69
|
+
print(trig.sin(constants.pi)) # prints 0
|
|
70
|
+
print(calculus.converges(lambda x: 1 / x)) # prints False
|
|
71
|
+
```
|
|
72
|
+
* * *
|
|
73
|
+
## 🛣️ Roadmap
|
|
74
|
+
|
|
75
|
+
Upcoming improvements:
|
|
76
|
+
* Limit evaluation engine
|
|
77
|
+
* Convergence detection for series
|
|
78
|
+
* Combinatorics utilities, Pascal's Triangle
|
|
79
|
+
* Performance optimizations.
|
|
80
|
+
* * *
|
|
81
|
+
## 🤝 Contributing
|
|
82
|
+
|
|
83
|
+
Contributions are welcome!\You can help by:
|
|
84
|
+
* Reporting bugs in our [Discord](https://discord.com/channels/1484861326324138016/1484861327209140366)
|
|
85
|
+
* Adding suggestions
|
|
86
|
+
* Improving performance.
|
|
87
|
+
* * *
|
|
88
|
+
## 📦 Installation
|
|
89
|
+
|
|
90
|
+
You can install AxiomX by going into the terminal and typing *pip install AxiomX*.
|
|
91
|
+
* * *
|
|
92
|
+
## 📄 License
|
|
93
|
+
|
|
94
|
+
This software is licensed under MIT and no one is supposed to copy code from AxiomX.
|
|
95
|
+
* * *
|
|
96
|
+
## 🌐 Links
|
|
97
|
+
|
|
98
|
+
Website: [https://axiomxpy.wordpress.com](https://axiomxpy.wordpress.com)\
|
|
99
|
+
Discord Invite: [https://discord.gg/CrEf8mDB](https://discord.gg/CrEf8mDB)
|
|
100
|
+
* * *
|
|
101
|
+
|
|
102
|
+
## ⭐ Support
|
|
103
|
+
If you like AxiomX, consider:
|
|
104
|
+
* Sharing it with other friends
|
|
105
|
+
* Using it in your projects
|
|
106
|
+
* * *
|
|
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
|
|
|
2
2
|
|
|
3
3
|
setup(
|
|
4
4
|
name="AxiomX", # rename to your project name
|
|
5
|
-
version="0.1.
|
|
5
|
+
version="0.1.1",
|
|
6
6
|
description="A custom Python math library with special functions.",
|
|
7
7
|
author="Eric Joseph", # change if needed
|
|
8
8
|
packages=find_packages(),
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
# integrating integrals
|
|
2
|
-
def integrate(function, lowlim, uplim, n=10000):
|
|
3
|
-
h = (uplim - lowlim) / n
|
|
4
|
-
s = function(lowlim) + function(uplim)
|
|
5
|
-
|
|
6
|
-
for i in range(1, n):
|
|
7
|
-
x = lowlim + i * h
|
|
8
|
-
if i % 2 == 0:
|
|
9
|
-
s += 2 * function(x)
|
|
10
|
-
else:
|
|
11
|
-
s += 4 * function(x)
|
|
12
|
-
|
|
13
|
-
return s * h / 3
|
|
14
|
-
|
|
15
|
-
def summation(lowlim, uplim, function):
|
|
16
|
-
sum = 0
|
|
17
|
-
for _ in range(lowlim, uplim + 1):
|
|
18
|
-
sum += function(_)
|
|
19
|
-
return sum
|
|
20
|
-
|
|
21
|
-
def converges(f):
|
|
22
|
-
if (f(2) == 0.5):
|
|
23
|
-
return False
|
|
24
|
-
try:
|
|
25
|
-
n1 = 10**5
|
|
26
|
-
n2 = 10**6
|
|
27
|
-
|
|
28
|
-
a1 = abs(f(n1))
|
|
29
|
-
a2 = abs(f(n2))
|
|
30
|
-
|
|
31
|
-
# 1) nth-term test (stronger)
|
|
32
|
-
if a2 > 1e-3:
|
|
33
|
-
return False
|
|
34
|
-
|
|
35
|
-
# 2) Ratio test
|
|
36
|
-
if a1 != 0:
|
|
37
|
-
L = abs(a2 / a1)
|
|
38
|
-
if L < 0.9:
|
|
39
|
-
return True
|
|
40
|
-
if L > 1.1:
|
|
41
|
-
return False
|
|
42
|
-
|
|
43
|
-
# 3) Alternating test
|
|
44
|
-
if f(1000) * f(1001) < 0 and a2 < a1:
|
|
45
|
-
return "Conditional"
|
|
46
|
-
|
|
47
|
-
# 4) Partial sum growth test
|
|
48
|
-
S1 = sum(f(n) for n in range(1,2000))
|
|
49
|
-
S2 = sum(f(n) for n in range(1,4000))
|
|
50
|
-
|
|
51
|
-
if abs(S2) > abs(S1) * 1.2:
|
|
52
|
-
return False
|
|
53
|
-
|
|
54
|
-
if abs(S2 - S1) < 1e-3:
|
|
55
|
-
return True
|
|
56
|
-
|
|
57
|
-
except:
|
|
58
|
-
return "Inconclusive"
|
|
59
|
-
|
|
60
|
-
return "Inconclusive"
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: AxiomX
|
|
3
|
-
Version: 0.1.0.dev8
|
|
4
|
-
Summary: A dynamic Python math library containing numerous mathematical functions implemented from scratch.
|
|
5
|
-
Author: Eric Joseph
|
|
6
|
-
License: MIT
|
|
7
|
-
Requires-Python: >=2.7
|
|
8
|
-
Description-Content-Type: text/markdown
|
|
9
|
-
License-File: LICENSE
|
|
10
|
-
Dynamic: license-file
|
|
11
|
-
Dynamic: requires-python
|
|
12
|
-
|
|
13
|
-
# AxiomX 0.1.0.dev8
|
|
14
|
-
|
|
15
|
-
AxiomX is proud to release the 0.1.0.dev8 bugfix release. We're extremely sorry for the inconvenience we have caused. We had realized about a bug running in our module. We have fixed it and as this is a bugfix release, we have not added anything new.
|
|
16
|
-
\
|
|
17
|
-
\
|
|
18
|
-
This module is licensed under MIT. No one is allowed to copy code from AxiomX. Hope you all enjoy AxiomX.
|
axiomx-0.1.0.dev8/PKG-INFO
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: AxiomX
|
|
3
|
-
Version: 0.1.0.dev8
|
|
4
|
-
Summary: A dynamic Python math library containing numerous mathematical functions implemented from scratch.
|
|
5
|
-
Author: Eric Joseph
|
|
6
|
-
License: MIT
|
|
7
|
-
Requires-Python: >=2.7
|
|
8
|
-
Description-Content-Type: text/markdown
|
|
9
|
-
License-File: LICENSE
|
|
10
|
-
Dynamic: license-file
|
|
11
|
-
Dynamic: requires-python
|
|
12
|
-
|
|
13
|
-
# AxiomX 0.1.0.dev8
|
|
14
|
-
|
|
15
|
-
AxiomX is proud to release the 0.1.0.dev8 bugfix release. We're extremely sorry for the inconvenience we have caused. We had realized about a bug running in our module. We have fixed it and as this is a bugfix release, we have not added anything new.
|
|
16
|
-
\
|
|
17
|
-
\
|
|
18
|
-
This module is licensed under MIT. No one is allowed to copy code from AxiomX. Hope you all enjoy AxiomX.
|
axiomx-0.1.0.dev8/README.md
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
# AxiomX 0.1.0.dev8
|
|
2
|
-
|
|
3
|
-
AxiomX is proud to release the 0.1.0.dev8 bugfix release. We're extremely sorry for the inconvenience we have caused. We had realized about a bug running in our module. We have fixed it and as this is a bugfix release, we have not added anything new.
|
|
4
|
-
\
|
|
5
|
-
\
|
|
6
|
-
This module is licensed under MIT. No one is allowed to copy code from AxiomX. Hope you all enjoy AxiomX.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|