AxiomX 0.1.2__tar.gz → 0.1.3__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.3/AxiomX/constants.py +35 -0
- {axiomx-0.1.2 → axiomx-0.1.3}/AxiomX/exp.py +2 -0
- {axiomx-0.1.2 → axiomx-0.1.3}/AxiomX/functions.py +13 -3
- axiomx-0.1.3/AxiomX/graph.py +112 -0
- {axiomx-0.1.2 → axiomx-0.1.3}/AxiomX/hyperbolic.py +6 -3
- {axiomx-0.1.2 → axiomx-0.1.3}/AxiomX/matrix.py +88 -2
- {axiomx-0.1.2 → axiomx-0.1.3}/AxiomX.egg-info/PKG-INFO +24 -11
- {axiomx-0.1.2 → axiomx-0.1.3}/AxiomX.egg-info/SOURCES.txt +1 -0
- {axiomx-0.1.2 → axiomx-0.1.3}/PKG-INFO +24 -11
- {axiomx-0.1.2 → axiomx-0.1.3}/README.md +23 -10
- {axiomx-0.1.2 → axiomx-0.1.3}/pyproject.toml +1 -1
- {axiomx-0.1.2 → axiomx-0.1.3}/setup.py +1 -1
- axiomx-0.1.2/AxiomX/constants.py +0 -17
- {axiomx-0.1.2 → axiomx-0.1.3}/AxiomX/__init__.py +0 -0
- {axiomx-0.1.2 → axiomx-0.1.3}/AxiomX/calculus.py +0 -0
- {axiomx-0.1.2 → axiomx-0.1.3}/AxiomX/trig.py +0 -0
- {axiomx-0.1.2 → axiomx-0.1.3}/AxiomX.egg-info/dependency_links.txt +0 -0
- {axiomx-0.1.2 → axiomx-0.1.3}/AxiomX.egg-info/top_level.txt +0 -0
- {axiomx-0.1.2 → axiomx-0.1.3}/LICENSE +0 -0
- {axiomx-0.1.2 → axiomx-0.1.3}/setup.cfg +0 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
from AxiomX.calculus import *
|
|
2
|
+
from AxiomX.functions import *
|
|
3
|
+
|
|
4
|
+
pi = 3.141592653589793
|
|
5
|
+
e = 2.718281828459045
|
|
6
|
+
tau = 2*pi
|
|
7
|
+
lemniscate = 2.622057554292119
|
|
8
|
+
gauss = lemniscate / pi
|
|
9
|
+
euler_mascheroni = 0.577215664901533
|
|
10
|
+
sqrt_2 = 2**0.5
|
|
11
|
+
sqrt_3 = 3**0.5
|
|
12
|
+
sqrt_5 = 5**0.5
|
|
13
|
+
golden_ratio = (1 + sqrt_5) / 2
|
|
14
|
+
silver_ratio = 1 + sqrt_2
|
|
15
|
+
gelfond = e**pi
|
|
16
|
+
gelfond_schneider = 2**sqrt_2
|
|
17
|
+
infinity = float("inf")
|
|
18
|
+
|
|
19
|
+
def metallic_ratio(n):
|
|
20
|
+
return (n + (n**2 + 4)**0.5) / 2
|
|
21
|
+
|
|
22
|
+
def harmonic_number(n):
|
|
23
|
+
return summation(1, n, lambda x:1/x)
|
|
24
|
+
|
|
25
|
+
def bernoulli(n):
|
|
26
|
+
B = [0] * (n + 1)
|
|
27
|
+
B[0] = 1
|
|
28
|
+
|
|
29
|
+
for m in range(1, n + 1):
|
|
30
|
+
B[m] = 0
|
|
31
|
+
for k in range(m):
|
|
32
|
+
B[m] -= (bc(m + 1, k) * B[k])
|
|
33
|
+
B[m] /= (m + 1)
|
|
34
|
+
|
|
35
|
+
return B[n]
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from AxiomX.constants import *
|
|
2
|
+
|
|
1
3
|
def absolute(x):
|
|
2
4
|
if (x > 0):
|
|
3
5
|
return x
|
|
@@ -75,7 +77,7 @@ def zeta(n):
|
|
|
75
77
|
zetval = 0
|
|
76
78
|
if n <= 1:
|
|
77
79
|
raise ValueError("zeta(n) diverges for n <= 1")
|
|
78
|
-
for _ in range(1,
|
|
80
|
+
for _ in range(1, 1000001):
|
|
79
81
|
zetval += (1 / _**n)
|
|
80
82
|
return zetval
|
|
81
83
|
|
|
@@ -83,7 +85,7 @@ def beta(n):
|
|
|
83
85
|
if n == 0:
|
|
84
86
|
return 0.5
|
|
85
87
|
total = 0.0
|
|
86
|
-
for i in range(
|
|
88
|
+
for i in range(1000000):
|
|
87
89
|
total += ((-1)**i) / ((2*i + 1)**n)
|
|
88
90
|
return total
|
|
89
91
|
|
|
@@ -103,4 +105,12 @@ def pascal(row):
|
|
|
103
105
|
pr = []
|
|
104
106
|
for i in range(0, row+1):
|
|
105
107
|
pr.append(int(bc(row, i)))
|
|
106
|
-
return pr
|
|
108
|
+
return pr
|
|
109
|
+
|
|
110
|
+
def perm(n, r):
|
|
111
|
+
if n < r or n < 0 or r < 0:
|
|
112
|
+
return 0
|
|
113
|
+
result = 1
|
|
114
|
+
for i in range(r):
|
|
115
|
+
result *= (n - i)
|
|
116
|
+
return result
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import turtle
|
|
2
|
+
|
|
3
|
+
def plot(funcs, start, end, step=0.1, scale=20, limit=1000):
|
|
4
|
+
if not isinstance(funcs, list):
|
|
5
|
+
funcs = [funcs]
|
|
6
|
+
screen = turtle.Screen()
|
|
7
|
+
screen.title("AxiomX Graph")
|
|
8
|
+
|
|
9
|
+
t = turtle.Turtle()
|
|
10
|
+
t.speed(0)
|
|
11
|
+
t.hideturtle()
|
|
12
|
+
|
|
13
|
+
# =========================
|
|
14
|
+
# AXES + NUMBER LINES
|
|
15
|
+
# =========================
|
|
16
|
+
|
|
17
|
+
# Axes
|
|
18
|
+
t.penup()
|
|
19
|
+
t.goto(-400, 0)
|
|
20
|
+
t.pendown()
|
|
21
|
+
t.goto(400, 0)
|
|
22
|
+
|
|
23
|
+
t.penup()
|
|
24
|
+
t.goto(0, -300)
|
|
25
|
+
t.pendown()
|
|
26
|
+
t.goto(0, 300)
|
|
27
|
+
|
|
28
|
+
# ----- X-axis ticks -----
|
|
29
|
+
# ----- X-axis ticks (with proper negative handling) -----
|
|
30
|
+
|
|
31
|
+
tick_step = max(1, int((end - start) / 10))
|
|
32
|
+
|
|
33
|
+
x_tick = int(start // tick_step) * tick_step
|
|
34
|
+
|
|
35
|
+
while x_tick <= end:
|
|
36
|
+
sx = x_tick * scale
|
|
37
|
+
|
|
38
|
+
# Tick
|
|
39
|
+
t.penup()
|
|
40
|
+
t.goto(sx, -5)
|
|
41
|
+
t.pendown()
|
|
42
|
+
t.goto(sx, 5)
|
|
43
|
+
|
|
44
|
+
# Label
|
|
45
|
+
t.penup()
|
|
46
|
+
t.goto(sx, -20)
|
|
47
|
+
|
|
48
|
+
label = "0" if abs(x_tick) < 1e-9 else str(x_tick)
|
|
49
|
+
t.write(label, align="center", font=("Arial", 8, "normal"))
|
|
50
|
+
|
|
51
|
+
x_tick += tick_step
|
|
52
|
+
|
|
53
|
+
# ----- Y-axis ticks -----
|
|
54
|
+
# Estimate visible y-range based on screen height
|
|
55
|
+
y_range = 300 / scale
|
|
56
|
+
y_tick_step = max(1, int((2 * y_range) / 10))
|
|
57
|
+
|
|
58
|
+
y_tick = int(-y_range)
|
|
59
|
+
while y_tick <= y_range:
|
|
60
|
+
sy = y_tick * scale
|
|
61
|
+
|
|
62
|
+
# Skip origin label overlap (optional)
|
|
63
|
+
if y_tick == 0:
|
|
64
|
+
y_tick += y_tick_step
|
|
65
|
+
continue
|
|
66
|
+
|
|
67
|
+
# Tick
|
|
68
|
+
t.penup()
|
|
69
|
+
t.goto(-5, sy)
|
|
70
|
+
t.pendown()
|
|
71
|
+
t.goto(5, sy)
|
|
72
|
+
|
|
73
|
+
# Label
|
|
74
|
+
t.penup()
|
|
75
|
+
t.goto(-25, sy - 5)
|
|
76
|
+
t.write(f"{y_tick}", align="right", font=("Arial", 8, "normal"))
|
|
77
|
+
|
|
78
|
+
y_tick += y_tick_step
|
|
79
|
+
colors = ["red", "blue", "green", "purple"]
|
|
80
|
+
|
|
81
|
+
for i, f in enumerate(funcs):
|
|
82
|
+
t.color(colors[i % len(colors)])
|
|
83
|
+
t.penup()
|
|
84
|
+
|
|
85
|
+
x = start
|
|
86
|
+
drawing = False
|
|
87
|
+
|
|
88
|
+
while x <= end:
|
|
89
|
+
try:
|
|
90
|
+
y = f(x)
|
|
91
|
+
|
|
92
|
+
if y is None or abs(y) > limit:
|
|
93
|
+
raise ValueError
|
|
94
|
+
|
|
95
|
+
sx = x * scale
|
|
96
|
+
sy = y * scale
|
|
97
|
+
|
|
98
|
+
if not drawing:
|
|
99
|
+
t.penup()
|
|
100
|
+
t.goto(sx, sy)
|
|
101
|
+
t.pendown()
|
|
102
|
+
drawing = True
|
|
103
|
+
else:
|
|
104
|
+
t.goto(sx, sy)
|
|
105
|
+
|
|
106
|
+
except turtle.Terminator:
|
|
107
|
+
return
|
|
108
|
+
except:
|
|
109
|
+
t.penup()
|
|
110
|
+
drawing = False
|
|
111
|
+
|
|
112
|
+
x += step
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
from AxiomX.exp import ln
|
|
2
|
+
from AxiomX.constants import e
|
|
3
|
+
|
|
1
4
|
def sinh(x):
|
|
2
5
|
return (e**x - e**(-x))/2
|
|
3
6
|
|
|
@@ -17,13 +20,13 @@ def cosech(x):
|
|
|
17
20
|
return 1 / sinh(x)
|
|
18
21
|
|
|
19
22
|
def arcsinh(x):
|
|
20
|
-
return ln(x +
|
|
23
|
+
return ln(x + (x**2 + 1)**0.5)
|
|
21
24
|
|
|
22
25
|
def arccosh(x):
|
|
23
|
-
return abs(arcsinh(
|
|
26
|
+
return abs(arcsinh((x**2 - 1)**0.5))
|
|
24
27
|
|
|
25
28
|
def arccoth(x):
|
|
26
|
-
return 0.5 * ((x+1)/(x-1))
|
|
29
|
+
return 0.5 * ln((x+1)/(x-1))
|
|
27
30
|
|
|
28
31
|
def arctanh(x):
|
|
29
32
|
return arccoth(1/x)
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
class Matrix:
|
|
2
2
|
def __str__(self):
|
|
3
|
+
"""
|
|
4
|
+
Makes it suitable for printing.
|
|
5
|
+
"""
|
|
3
6
|
result = ""
|
|
4
7
|
for row in self.matrix:
|
|
5
8
|
result += " ".join(str(x) for x in row) + "\n"
|
|
6
9
|
return result
|
|
7
10
|
|
|
8
11
|
def __init__(self, rows, columns):
|
|
12
|
+
"""
|
|
13
|
+
Initializes a matrix.
|
|
14
|
+
"""
|
|
9
15
|
self.rows = rows
|
|
10
16
|
self.columns = columns
|
|
11
17
|
self.order = (rows,columns)
|
|
@@ -19,6 +25,9 @@ class Matrix:
|
|
|
19
25
|
|
|
20
26
|
@classmethod
|
|
21
27
|
def from_list(cls, data):
|
|
28
|
+
"""
|
|
29
|
+
This class method helps in loading a matrix from its list form.
|
|
30
|
+
"""
|
|
22
31
|
rows = len(data)
|
|
23
32
|
columns = len(data[0]) if rows > 0 else 0
|
|
24
33
|
|
|
@@ -27,16 +36,26 @@ class Matrix:
|
|
|
27
36
|
return obj
|
|
28
37
|
|
|
29
38
|
def transpose(self):
|
|
39
|
+
"""
|
|
40
|
+
This method helps in transposing a matrix.
|
|
41
|
+
"""
|
|
30
42
|
data = [[self.matrix[i][j] for i in range(self.rows)] for j in range(self.columns)]
|
|
31
43
|
return Matrix.from_list(data)
|
|
32
44
|
|
|
33
45
|
def zero(self):
|
|
46
|
+
"""
|
|
47
|
+
This method makes a matrix a zero matrix, whether the matrix was already having values or not.
|
|
48
|
+
"""
|
|
34
49
|
self.matrix = []
|
|
35
50
|
self.matrix = [[0 for _ in range(self.columns)] for _ in range(self.rows)]
|
|
36
51
|
|
|
37
52
|
def identity(self):
|
|
53
|
+
"""
|
|
54
|
+
This method makes a matrix an identity matrix, whether the matrix was already having values or not.
|
|
55
|
+
"""
|
|
38
56
|
self.matrix = [] # reset matrix
|
|
39
|
-
|
|
57
|
+
if (self.rows != self.columns):
|
|
58
|
+
raise ValueError("Identity matrix is a square matrix")
|
|
40
59
|
for i in range(self.rows):
|
|
41
60
|
row = []
|
|
42
61
|
for j in range(self.columns):
|
|
@@ -47,12 +66,18 @@ class Matrix:
|
|
|
47
66
|
self.matrix.append(row)
|
|
48
67
|
|
|
49
68
|
def __getitem__(self, key):
|
|
69
|
+
"""
|
|
70
|
+
This method helps in indexing.
|
|
71
|
+
"""
|
|
50
72
|
if isinstance(key, tuple):
|
|
51
73
|
i, j = key
|
|
52
74
|
return self.matrix[i][j]
|
|
53
75
|
return self.matrix[key]
|
|
54
76
|
|
|
55
77
|
def __setitem__(self, key, value):
|
|
78
|
+
"""
|
|
79
|
+
This method helps in setting values with a particular index.
|
|
80
|
+
"""
|
|
56
81
|
if isinstance(key, tuple):
|
|
57
82
|
i, j = key
|
|
58
83
|
self.matrix[i][j] = value
|
|
@@ -60,6 +85,9 @@ class Matrix:
|
|
|
60
85
|
self.matrix[key] = value
|
|
61
86
|
|
|
62
87
|
def __add__(self, other):
|
|
88
|
+
"""
|
|
89
|
+
This method overloads the + operator for adding two matrices.
|
|
90
|
+
"""
|
|
63
91
|
if self.rows != other.rows or self.columns != other.columns:
|
|
64
92
|
raise ValueError("matrices cannot be added")
|
|
65
93
|
|
|
@@ -71,6 +99,9 @@ class Matrix:
|
|
|
71
99
|
return Matrix.from_list(data)
|
|
72
100
|
|
|
73
101
|
def __sub__(self, other):
|
|
102
|
+
"""
|
|
103
|
+
This method overloads the - operator to subtract two matrices.
|
|
104
|
+
"""
|
|
74
105
|
if self.rows != other.rows or self.columns != other.columns:
|
|
75
106
|
raise ValueError("matrices cannot be added")
|
|
76
107
|
|
|
@@ -82,6 +113,9 @@ class Matrix:
|
|
|
82
113
|
return Matrix.from_list(data)
|
|
83
114
|
|
|
84
115
|
def __mul__(self, other):
|
|
116
|
+
"""
|
|
117
|
+
This method overloads the * operator for multiplying two matrices.
|
|
118
|
+
"""
|
|
85
119
|
if isinstance(other, (int, float)):
|
|
86
120
|
return Matrix.from_list([
|
|
87
121
|
[self[i, j] * other for j in range(self.columns)]
|
|
@@ -102,6 +136,9 @@ class Matrix:
|
|
|
102
136
|
return Matrix.from_list(data)
|
|
103
137
|
|
|
104
138
|
def det(self):
|
|
139
|
+
"""
|
|
140
|
+
This method calculates the determinant of any square matrix.
|
|
141
|
+
"""
|
|
105
142
|
if self.rows != self.columns:
|
|
106
143
|
raise ValueError("determinant is only defined for square matrices")
|
|
107
144
|
|
|
@@ -131,12 +168,18 @@ class Matrix:
|
|
|
131
168
|
return determinant
|
|
132
169
|
|
|
133
170
|
def _minor(self, i, j):
|
|
171
|
+
"""
|
|
172
|
+
This method returns the minor of any element in the matrix.
|
|
173
|
+
"""
|
|
134
174
|
return Matrix.from_list([
|
|
135
175
|
[self[r, c] for c in range(self.columns) if c != j]
|
|
136
176
|
for r in range(self.rows) if r != i
|
|
137
177
|
])
|
|
138
178
|
|
|
139
179
|
def _cofactor_matrix(self):
|
|
180
|
+
"""
|
|
181
|
+
This method returns the cofactor matrix of a matrix.
|
|
182
|
+
"""
|
|
140
183
|
data = []
|
|
141
184
|
|
|
142
185
|
for i in range(self.rows):
|
|
@@ -150,6 +193,9 @@ class Matrix:
|
|
|
150
193
|
return Matrix.from_list(data)
|
|
151
194
|
|
|
152
195
|
def inverse(self):
|
|
196
|
+
"""
|
|
197
|
+
This method returns the inverse of a matrix.
|
|
198
|
+
"""
|
|
153
199
|
if self.rows != self.columns:
|
|
154
200
|
raise ValueError("Inverse only defined for square matrices")
|
|
155
201
|
|
|
@@ -169,9 +215,15 @@ class Matrix:
|
|
|
169
215
|
return adjoint*(1 / det)
|
|
170
216
|
|
|
171
217
|
def __truediv__(self, other):
|
|
218
|
+
"""
|
|
219
|
+
This method overloads the / operator for division of two matrices.
|
|
220
|
+
"""
|
|
172
221
|
return self*other.inverse()
|
|
173
222
|
|
|
174
223
|
def __pow__(self, other):
|
|
224
|
+
"""
|
|
225
|
+
This method overloads the ** operator to multiply the matrix n times (works only for square matrices).
|
|
226
|
+
"""
|
|
175
227
|
if not isinstance(other, int):
|
|
176
228
|
raise ValueError("exponent is not a number")
|
|
177
229
|
else:
|
|
@@ -179,4 +231,38 @@ class Matrix:
|
|
|
179
231
|
p.identity()
|
|
180
232
|
for i in range(other):
|
|
181
233
|
p *= self
|
|
182
|
-
return p
|
|
234
|
+
return p
|
|
235
|
+
|
|
236
|
+
def rank(self):
|
|
237
|
+
A = [row[:] for row in self] # copy
|
|
238
|
+
n = len(A)
|
|
239
|
+
m = len(A[0])
|
|
240
|
+
|
|
241
|
+
rank = 0
|
|
242
|
+
row = 0
|
|
243
|
+
|
|
244
|
+
for col in range(m):
|
|
245
|
+
pivot = None
|
|
246
|
+
for r in range(row, n):
|
|
247
|
+
if A[r][col] != 0:
|
|
248
|
+
pivot = r
|
|
249
|
+
break
|
|
250
|
+
|
|
251
|
+
if pivot is not None:
|
|
252
|
+
A[row], A[pivot] = A[pivot], A[row]
|
|
253
|
+
|
|
254
|
+
pivot_val = A[row][col]
|
|
255
|
+
for j in range(col, m):
|
|
256
|
+
A[row][j] /= pivot_val
|
|
257
|
+
|
|
258
|
+
for r in range(n):
|
|
259
|
+
if r != row:
|
|
260
|
+
factor = A[r][col]
|
|
261
|
+
for j in range(col, m):
|
|
262
|
+
A[r][j] -= factor * A[row][j]
|
|
263
|
+
|
|
264
|
+
row += 1
|
|
265
|
+
rank += 1
|
|
266
|
+
|
|
267
|
+
return rank
|
|
268
|
+
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: AxiomX
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.3
|
|
4
4
|
Summary: A dynamic Python math library containing numerous mathematical functions implemented from scratch.
|
|
5
5
|
Author: Eric Joseph
|
|
6
6
|
License: MIT
|
|
@@ -20,18 +20,18 @@ exploration.
|
|
|
20
20
|
|
|
21
21
|
## 📢 Community
|
|
22
22
|
|
|
23
|
-
Join Discord for updates and feature requests. Join [here](https://discord.gg/
|
|
23
|
+
Join Discord for updates and feature requests. Join [here](https://discord.gg/yhN5eYwT).
|
|
24
24
|
|
|
25
25
|
------------------------------------------------------------------------
|
|
26
26
|
|
|
27
27
|
## 🚀 Features
|
|
28
28
|
|
|
29
|
-
### 📐 Core Mathematics
|
|
29
|
+
### 📐 Core Mathematics (AxiomX.constants)
|
|
30
30
|
|
|
31
31
|
- Constants (π, e, φ, √2, γ, ...)
|
|
32
32
|
- Custom implementations
|
|
33
33
|
|
|
34
|
-
### 📈 Exponential & Logarithmic
|
|
34
|
+
### 📈 Exponential & Logarithmic (AxiomX.exp)
|
|
35
35
|
|
|
36
36
|
- exp(x)
|
|
37
37
|
- ln(x)
|
|
@@ -39,22 +39,25 @@ Join Discord for updates and feature requests. Join [here](https://discord.gg/Cr
|
|
|
39
39
|
- log2(x)
|
|
40
40
|
- log(arg, base)
|
|
41
41
|
|
|
42
|
-
### 📐 Trigonometry
|
|
42
|
+
### 📐 Trigonometry (AxiomX.trig)
|
|
43
43
|
|
|
44
44
|
- sin, cos, tan, cot, sec, cosec
|
|
45
45
|
- inverse functions
|
|
46
46
|
|
|
47
|
-
### 🔢 Hyperbolic Functions
|
|
47
|
+
### 🔢 Hyperbolic Functions (AxiomX.hyperbolic)
|
|
48
48
|
|
|
49
49
|
- sinh, cosh, tanh, coth
|
|
50
50
|
|
|
51
|
-
### 🧮 General Functions
|
|
51
|
+
### 🧮 General Functions (AxiomX.functions)
|
|
52
52
|
|
|
53
53
|
- absolute(x)
|
|
54
54
|
- sqrt(x)
|
|
55
55
|
- gamma(x)
|
|
56
56
|
- cbrt(x)
|
|
57
57
|
- zeta(n) and beta(n)
|
|
58
|
+
- bc(n, k) - **NEW**
|
|
59
|
+
- perm(n, K) - **NEW**
|
|
60
|
+
- pascal(row) - **NEW**
|
|
58
61
|
|
|
59
62
|
### ∫ Calculus
|
|
60
63
|
|
|
@@ -63,9 +66,7 @@ Join Discord for updates and feature requests. Join [here](https://discord.gg/Cr
|
|
|
63
66
|
- convergence analysis
|
|
64
67
|
- limit evaluation
|
|
65
68
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
## 🧱 Matrix Engine (NEW)
|
|
69
|
+
### 🧱 Matrix Engine
|
|
69
70
|
|
|
70
71
|
- Matrix creation
|
|
71
72
|
- A\[i, j\] access
|
|
@@ -74,6 +75,7 @@ Join Discord for updates and feature requests. Join [here](https://discord.gg/Cr
|
|
|
74
75
|
- Determinant
|
|
75
76
|
- Inverse
|
|
76
77
|
- Division (via inverse) by using / operator
|
|
78
|
+
- Rank of a Matrix by Gaussian elimination (**NEW**)
|
|
77
79
|
|
|
78
80
|
If you want to create a zero matrix or identity of any order, you can do it this way:
|
|
79
81
|
|
|
@@ -94,6 +96,16 @@ a = Matrix.from_list([]) # enter your matrix in it.
|
|
|
94
96
|
```
|
|
95
97
|
------------------------------------------------------------------------
|
|
96
98
|
|
|
99
|
+
## 📈 GRAPH ENGINE - **NEW** (included in AxiomX.graph)
|
|
100
|
+
|
|
101
|
+
AxiomX has introduced a killer feature - graphing. Just like how `matplotlib` is for numpy, AxiomX has introduced a graph module. It has only one function:
|
|
102
|
+
|
|
103
|
+
- plot(functions, start, end)
|
|
104
|
+
|
|
105
|
+
The functions argument can a function or list of functions. It also contains a scale and you can provide a starting and ending limit. We will add zooming later.
|
|
106
|
+
|
|
107
|
+
------------------------------------------------------------------------
|
|
108
|
+
|
|
97
109
|
## 📦 Installation
|
|
98
110
|
|
|
99
111
|
`pip install axiomx`
|
|
@@ -104,7 +116,8 @@ a = Matrix.from_list([]) # enter your matrix in it.
|
|
|
104
116
|
```
|
|
105
117
|
from AxiomX.matrix import Matrix
|
|
106
118
|
|
|
107
|
-
A = Matrix.from_list(
|
|
119
|
+
A = Matrix.from_list([1, 2], [3, 4]])
|
|
120
|
+
print(A.det())
|
|
108
121
|
```
|
|
109
122
|
|
|
110
123
|
------------------------------------------------------------------------
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: AxiomX
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.3
|
|
4
4
|
Summary: A dynamic Python math library containing numerous mathematical functions implemented from scratch.
|
|
5
5
|
Author: Eric Joseph
|
|
6
6
|
License: MIT
|
|
@@ -20,18 +20,18 @@ exploration.
|
|
|
20
20
|
|
|
21
21
|
## 📢 Community
|
|
22
22
|
|
|
23
|
-
Join Discord for updates and feature requests. Join [here](https://discord.gg/
|
|
23
|
+
Join Discord for updates and feature requests. Join [here](https://discord.gg/yhN5eYwT).
|
|
24
24
|
|
|
25
25
|
------------------------------------------------------------------------
|
|
26
26
|
|
|
27
27
|
## 🚀 Features
|
|
28
28
|
|
|
29
|
-
### 📐 Core Mathematics
|
|
29
|
+
### 📐 Core Mathematics (AxiomX.constants)
|
|
30
30
|
|
|
31
31
|
- Constants (π, e, φ, √2, γ, ...)
|
|
32
32
|
- Custom implementations
|
|
33
33
|
|
|
34
|
-
### 📈 Exponential & Logarithmic
|
|
34
|
+
### 📈 Exponential & Logarithmic (AxiomX.exp)
|
|
35
35
|
|
|
36
36
|
- exp(x)
|
|
37
37
|
- ln(x)
|
|
@@ -39,22 +39,25 @@ Join Discord for updates and feature requests. Join [here](https://discord.gg/Cr
|
|
|
39
39
|
- log2(x)
|
|
40
40
|
- log(arg, base)
|
|
41
41
|
|
|
42
|
-
### 📐 Trigonometry
|
|
42
|
+
### 📐 Trigonometry (AxiomX.trig)
|
|
43
43
|
|
|
44
44
|
- sin, cos, tan, cot, sec, cosec
|
|
45
45
|
- inverse functions
|
|
46
46
|
|
|
47
|
-
### 🔢 Hyperbolic Functions
|
|
47
|
+
### 🔢 Hyperbolic Functions (AxiomX.hyperbolic)
|
|
48
48
|
|
|
49
49
|
- sinh, cosh, tanh, coth
|
|
50
50
|
|
|
51
|
-
### 🧮 General Functions
|
|
51
|
+
### 🧮 General Functions (AxiomX.functions)
|
|
52
52
|
|
|
53
53
|
- absolute(x)
|
|
54
54
|
- sqrt(x)
|
|
55
55
|
- gamma(x)
|
|
56
56
|
- cbrt(x)
|
|
57
57
|
- zeta(n) and beta(n)
|
|
58
|
+
- bc(n, k) - **NEW**
|
|
59
|
+
- perm(n, K) - **NEW**
|
|
60
|
+
- pascal(row) - **NEW**
|
|
58
61
|
|
|
59
62
|
### ∫ Calculus
|
|
60
63
|
|
|
@@ -63,9 +66,7 @@ Join Discord for updates and feature requests. Join [here](https://discord.gg/Cr
|
|
|
63
66
|
- convergence analysis
|
|
64
67
|
- limit evaluation
|
|
65
68
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
## 🧱 Matrix Engine (NEW)
|
|
69
|
+
### 🧱 Matrix Engine
|
|
69
70
|
|
|
70
71
|
- Matrix creation
|
|
71
72
|
- A\[i, j\] access
|
|
@@ -74,6 +75,7 @@ Join Discord for updates and feature requests. Join [here](https://discord.gg/Cr
|
|
|
74
75
|
- Determinant
|
|
75
76
|
- Inverse
|
|
76
77
|
- Division (via inverse) by using / operator
|
|
78
|
+
- Rank of a Matrix by Gaussian elimination (**NEW**)
|
|
77
79
|
|
|
78
80
|
If you want to create a zero matrix or identity of any order, you can do it this way:
|
|
79
81
|
|
|
@@ -94,6 +96,16 @@ a = Matrix.from_list([]) # enter your matrix in it.
|
|
|
94
96
|
```
|
|
95
97
|
------------------------------------------------------------------------
|
|
96
98
|
|
|
99
|
+
## 📈 GRAPH ENGINE - **NEW** (included in AxiomX.graph)
|
|
100
|
+
|
|
101
|
+
AxiomX has introduced a killer feature - graphing. Just like how `matplotlib` is for numpy, AxiomX has introduced a graph module. It has only one function:
|
|
102
|
+
|
|
103
|
+
- plot(functions, start, end)
|
|
104
|
+
|
|
105
|
+
The functions argument can a function or list of functions. It also contains a scale and you can provide a starting and ending limit. We will add zooming later.
|
|
106
|
+
|
|
107
|
+
------------------------------------------------------------------------
|
|
108
|
+
|
|
97
109
|
## 📦 Installation
|
|
98
110
|
|
|
99
111
|
`pip install axiomx`
|
|
@@ -104,7 +116,8 @@ a = Matrix.from_list([]) # enter your matrix in it.
|
|
|
104
116
|
```
|
|
105
117
|
from AxiomX.matrix import Matrix
|
|
106
118
|
|
|
107
|
-
A = Matrix.from_list(
|
|
119
|
+
A = Matrix.from_list([1, 2], [3, 4]])
|
|
120
|
+
print(A.det())
|
|
108
121
|
```
|
|
109
122
|
|
|
110
123
|
------------------------------------------------------------------------
|
|
@@ -8,18 +8,18 @@ exploration.
|
|
|
8
8
|
|
|
9
9
|
## 📢 Community
|
|
10
10
|
|
|
11
|
-
Join Discord for updates and feature requests. Join [here](https://discord.gg/
|
|
11
|
+
Join Discord for updates and feature requests. Join [here](https://discord.gg/yhN5eYwT).
|
|
12
12
|
|
|
13
13
|
------------------------------------------------------------------------
|
|
14
14
|
|
|
15
15
|
## 🚀 Features
|
|
16
16
|
|
|
17
|
-
### 📐 Core Mathematics
|
|
17
|
+
### 📐 Core Mathematics (AxiomX.constants)
|
|
18
18
|
|
|
19
19
|
- Constants (π, e, φ, √2, γ, ...)
|
|
20
20
|
- Custom implementations
|
|
21
21
|
|
|
22
|
-
### 📈 Exponential & Logarithmic
|
|
22
|
+
### 📈 Exponential & Logarithmic (AxiomX.exp)
|
|
23
23
|
|
|
24
24
|
- exp(x)
|
|
25
25
|
- ln(x)
|
|
@@ -27,22 +27,25 @@ Join Discord for updates and feature requests. Join [here](https://discord.gg/Cr
|
|
|
27
27
|
- log2(x)
|
|
28
28
|
- log(arg, base)
|
|
29
29
|
|
|
30
|
-
### 📐 Trigonometry
|
|
30
|
+
### 📐 Trigonometry (AxiomX.trig)
|
|
31
31
|
|
|
32
32
|
- sin, cos, tan, cot, sec, cosec
|
|
33
33
|
- inverse functions
|
|
34
34
|
|
|
35
|
-
### 🔢 Hyperbolic Functions
|
|
35
|
+
### 🔢 Hyperbolic Functions (AxiomX.hyperbolic)
|
|
36
36
|
|
|
37
37
|
- sinh, cosh, tanh, coth
|
|
38
38
|
|
|
39
|
-
### 🧮 General Functions
|
|
39
|
+
### 🧮 General Functions (AxiomX.functions)
|
|
40
40
|
|
|
41
41
|
- absolute(x)
|
|
42
42
|
- sqrt(x)
|
|
43
43
|
- gamma(x)
|
|
44
44
|
- cbrt(x)
|
|
45
45
|
- zeta(n) and beta(n)
|
|
46
|
+
- bc(n, k) - **NEW**
|
|
47
|
+
- perm(n, K) - **NEW**
|
|
48
|
+
- pascal(row) - **NEW**
|
|
46
49
|
|
|
47
50
|
### ∫ Calculus
|
|
48
51
|
|
|
@@ -51,9 +54,7 @@ Join Discord for updates and feature requests. Join [here](https://discord.gg/Cr
|
|
|
51
54
|
- convergence analysis
|
|
52
55
|
- limit evaluation
|
|
53
56
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
## 🧱 Matrix Engine (NEW)
|
|
57
|
+
### 🧱 Matrix Engine
|
|
57
58
|
|
|
58
59
|
- Matrix creation
|
|
59
60
|
- A\[i, j\] access
|
|
@@ -62,6 +63,7 @@ Join Discord for updates and feature requests. Join [here](https://discord.gg/Cr
|
|
|
62
63
|
- Determinant
|
|
63
64
|
- Inverse
|
|
64
65
|
- Division (via inverse) by using / operator
|
|
66
|
+
- Rank of a Matrix by Gaussian elimination (**NEW**)
|
|
65
67
|
|
|
66
68
|
If you want to create a zero matrix or identity of any order, you can do it this way:
|
|
67
69
|
|
|
@@ -82,6 +84,16 @@ a = Matrix.from_list([]) # enter your matrix in it.
|
|
|
82
84
|
```
|
|
83
85
|
------------------------------------------------------------------------
|
|
84
86
|
|
|
87
|
+
## 📈 GRAPH ENGINE - **NEW** (included in AxiomX.graph)
|
|
88
|
+
|
|
89
|
+
AxiomX has introduced a killer feature - graphing. Just like how `matplotlib` is for numpy, AxiomX has introduced a graph module. It has only one function:
|
|
90
|
+
|
|
91
|
+
- plot(functions, start, end)
|
|
92
|
+
|
|
93
|
+
The functions argument can a function or list of functions. It also contains a scale and you can provide a starting and ending limit. We will add zooming later.
|
|
94
|
+
|
|
95
|
+
------------------------------------------------------------------------
|
|
96
|
+
|
|
85
97
|
## 📦 Installation
|
|
86
98
|
|
|
87
99
|
`pip install axiomx`
|
|
@@ -92,7 +104,8 @@ a = Matrix.from_list([]) # enter your matrix in it.
|
|
|
92
104
|
```
|
|
93
105
|
from AxiomX.matrix import Matrix
|
|
94
106
|
|
|
95
|
-
A = Matrix.from_list(
|
|
107
|
+
A = Matrix.from_list([1, 2], [3, 4]])
|
|
108
|
+
print(A.det())
|
|
96
109
|
```
|
|
97
110
|
|
|
98
111
|
------------------------------------------------------------------------
|
|
@@ -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.3",
|
|
6
6
|
description="A custom Python math library with special functions.",
|
|
7
7
|
author="Eric Joseph", # change if needed
|
|
8
8
|
packages=find_packages(),
|
axiomx-0.1.2/AxiomX/constants.py
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
pi = 3.141592653589793
|
|
2
|
-
e = 2.718281828459045
|
|
3
|
-
tau = 2*pi
|
|
4
|
-
lemniscate = 2.622057554292119
|
|
5
|
-
gauss = lemniscate / pi
|
|
6
|
-
euler_mascheroni = 0.577215664901533
|
|
7
|
-
sqrt_2 = 2**0.5
|
|
8
|
-
sqrt_3 = 3**0.5
|
|
9
|
-
sqrt_5 = 5**0.5
|
|
10
|
-
golden_ratio = (1 + sqrt_5) / 2
|
|
11
|
-
silver_ratio = 1 + sqrt_2
|
|
12
|
-
gelfond = e**pi
|
|
13
|
-
gelfond_schneider = 2**sqrt_2
|
|
14
|
-
infinity = float("inf")
|
|
15
|
-
|
|
16
|
-
def metallic_ratio(n):
|
|
17
|
-
return (n + (n**2 + 4)**0.5) / 2
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|