mathai 2.2.1__tar.gz → 2.2.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.
- {mathai-2.2.1 → mathai-2.2.3}/PKG-INFO +27 -1
- {mathai-2.2.1 → mathai-2.2.3}/README.md +26 -0
- {mathai-2.2.1 → mathai-2.2.3}/mathai/__init__.py +2 -0
- mathai-2.2.3/mathai/graphics.py +55 -0
- {mathai-2.2.1 → mathai-2.2.3}/mathai.egg-info/PKG-INFO +27 -1
- {mathai-2.2.1 → mathai-2.2.3}/mathai.egg-info/SOURCES.txt +1 -0
- {mathai-2.2.1 → mathai-2.2.3}/setup.py +1 -1
- {mathai-2.2.1 → mathai-2.2.3}/mathai/apart.py +0 -0
- {mathai-2.2.1 → mathai-2.2.3}/mathai/base.py +0 -0
- {mathai-2.2.1 → mathai-2.2.3}/mathai/decision.py +0 -0
- {mathai-2.2.1 → mathai-2.2.3}/mathai/diff.py +0 -0
- {mathai-2.2.1 → mathai-2.2.3}/mathai/electronic.py +0 -0
- {mathai-2.2.1 → mathai-2.2.3}/mathai/expand.py +0 -0
- {mathai-2.2.1 → mathai-2.2.3}/mathai/factor.py +0 -0
- {mathai-2.2.1 → mathai-2.2.3}/mathai/formula/differentiation.marshal +0 -0
- {mathai-2.2.1 → mathai-2.2.3}/mathai/formula/integration.marshal +0 -0
- {mathai-2.2.1 → mathai-2.2.3}/mathai/formula/integration_trig.marshal +0 -0
- {mathai-2.2.1 → mathai-2.2.3}/mathai/formula/is_integrate_subs.marshal +0 -0
- {mathai-2.2.1 → mathai-2.2.3}/mathai/formula/lambda_compress.marshal +0 -0
- {mathai-2.2.1 → mathai-2.2.3}/mathai/formula/lambda_expand.marshal +0 -0
- {mathai-2.2.1 → mathai-2.2.3}/mathai/formula/lambda_reduce.marshal +0 -0
- {mathai-2.2.1 → mathai-2.2.3}/mathai/formula/limit_infinity.marshal +0 -0
- {mathai-2.2.1 → mathai-2.2.3}/mathai/formula/matrix_vectorization_calculus.marshal +0 -0
- {mathai-2.2.1 → mathai-2.2.3}/mathai/formula/power_rule.marshal +0 -0
- {mathai-2.2.1 → mathai-2.2.3}/mathai/formula/quadratic.marshal +0 -0
- {mathai-2.2.1 → mathai-2.2.3}/mathai/formula/statistics_1.marshal +0 -0
- {mathai-2.2.1 → mathai-2.2.3}/mathai/formula/statistics_2.marshal +0 -0
- {mathai-2.2.1 → mathai-2.2.3}/mathai/formula/test.marshal +0 -0
- {mathai-2.2.1 → mathai-2.2.3}/mathai/formula/trigonometry_misc.marshal +0 -0
- {mathai-2.2.1 → mathai-2.2.3}/mathai/formula_compiler.py +0 -0
- {mathai-2.2.1 → mathai-2.2.3}/mathai/formula_data.py +0 -0
- {mathai-2.2.1 → mathai-2.2.3}/mathai/formula_interpretor.py +0 -0
- {mathai-2.2.1 → mathai-2.2.3}/mathai/fraction.py +0 -0
- {mathai-2.2.1 → mathai-2.2.3}/mathai/integrate.py +0 -0
- {mathai-2.2.1 → mathai-2.2.3}/mathai/inverse.py +0 -0
- {mathai-2.2.1 → mathai-2.2.3}/mathai/lambda_calculus.py +0 -0
- {mathai-2.2.1 → mathai-2.2.3}/mathai/limit.py +0 -0
- {mathai-2.2.1 → mathai-2.2.3}/mathai/linear.py +0 -0
- {mathai-2.2.1 → mathai-2.2.3}/mathai/logic.py +0 -0
- {mathai-2.2.1 → mathai-2.2.3}/mathai/matrix.py +0 -0
- {mathai-2.2.1 → mathai-2.2.3}/mathai/ml.py +0 -0
- {mathai-2.2.1 → mathai-2.2.3}/mathai/mlscalar.py +0 -0
- {mathai-2.2.1 → mathai-2.2.3}/mathai/ode.py +0 -0
- {mathai-2.2.1 → mathai-2.2.3}/mathai/parser.py +0 -0
- {mathai-2.2.1 → mathai-2.2.3}/mathai/pde.py +0 -0
- {mathai-2.2.1 → mathai-2.2.3}/mathai/printeq.py +0 -0
- {mathai-2.2.1 → mathai-2.2.3}/mathai/qm.py +0 -0
- {mathai-2.2.1 → mathai-2.2.3}/mathai/simplify.py +0 -0
- {mathai-2.2.1 → mathai-2.2.3}/mathai/statistics.py +0 -0
- {mathai-2.2.1 → mathai-2.2.3}/mathai/test.py +0 -0
- {mathai-2.2.1 → mathai-2.2.3}/mathai/tool.py +0 -0
- {mathai-2.2.1 → mathai-2.2.3}/mathai/trig.py +0 -0
- {mathai-2.2.1 → mathai-2.2.3}/mathai/univariate_inequality.py +0 -0
- {mathai-2.2.1 → mathai-2.2.3}/mathai.egg-info/dependency_links.txt +0 -0
- {mathai-2.2.1 → mathai-2.2.3}/mathai.egg-info/requires.txt +0 -0
- {mathai-2.2.1 → mathai-2.2.3}/mathai.egg-info/top_level.txt +0 -0
- {mathai-2.2.1 → mathai-2.2.3}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mathai
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.3
|
|
4
4
|
Summary: Mathematics solving Ai tailored to NCERT
|
|
5
5
|
Home-page: https://github.com/infinity390/mathai
|
|
6
6
|
Requires-Python: >=3.7
|
|
@@ -450,6 +450,32 @@ done
|
|
|
450
450
|
8.66474543707973
|
|
451
451
|
```
|
|
452
452
|
|
|
453
|
+
#### Example Demonstration 11 (engineering graphics)
|
|
454
|
+
```python
|
|
455
|
+
from mathai import *
|
|
456
|
+
# (z,y) is dash, a'b' is front view
|
|
457
|
+
# (z,-x) is no dash, ab is top view
|
|
458
|
+
solve_graphics_string("30 20 0 None None None None None None 0 40*pi/180 None None 60")
|
|
459
|
+
```
|
|
460
|
+
|
|
461
|
+
#### Output
|
|
462
|
+
```
|
|
463
|
+
Ax : 30
|
|
464
|
+
Ay : 20
|
|
465
|
+
Az : 0
|
|
466
|
+
Bx : 30
|
|
467
|
+
By : 20+(60*sin(((2*pi)/9)))
|
|
468
|
+
Bz : 60*abs(cos(((2*pi)/9)))
|
|
469
|
+
Bx-Ax : 0
|
|
470
|
+
By-Ay : 60*sin(((2*pi)/9))
|
|
471
|
+
Bz-Az : 60*abs(cos(((2*pi)/9)))
|
|
472
|
+
inclination_with_VP : 0
|
|
473
|
+
inclination_with_HP : (2*pi)/9
|
|
474
|
+
front_view_length : 60
|
|
475
|
+
top_view_length : 60*abs(cos(((2*pi)/9)))
|
|
476
|
+
line_length : 60
|
|
477
|
+
```
|
|
478
|
+
|
|
453
479
|
### Questions solved using god() function
|
|
454
480
|
|
|
455
481
|
#### Code
|
|
@@ -434,6 +434,32 @@ done
|
|
|
434
434
|
8.66474543707973
|
|
435
435
|
```
|
|
436
436
|
|
|
437
|
+
#### Example Demonstration 11 (engineering graphics)
|
|
438
|
+
```python
|
|
439
|
+
from mathai import *
|
|
440
|
+
# (z,y) is dash, a'b' is front view
|
|
441
|
+
# (z,-x) is no dash, ab is top view
|
|
442
|
+
solve_graphics_string("30 20 0 None None None None None None 0 40*pi/180 None None 60")
|
|
443
|
+
```
|
|
444
|
+
|
|
445
|
+
#### Output
|
|
446
|
+
```
|
|
447
|
+
Ax : 30
|
|
448
|
+
Ay : 20
|
|
449
|
+
Az : 0
|
|
450
|
+
Bx : 30
|
|
451
|
+
By : 20+(60*sin(((2*pi)/9)))
|
|
452
|
+
Bz : 60*abs(cos(((2*pi)/9)))
|
|
453
|
+
Bx-Ax : 0
|
|
454
|
+
By-Ay : 60*sin(((2*pi)/9))
|
|
455
|
+
Bz-Az : 60*abs(cos(((2*pi)/9)))
|
|
456
|
+
inclination_with_VP : 0
|
|
457
|
+
inclination_with_HP : (2*pi)/9
|
|
458
|
+
front_view_length : 60
|
|
459
|
+
top_view_length : 60*abs(cos(((2*pi)/9)))
|
|
460
|
+
line_length : 60
|
|
461
|
+
```
|
|
462
|
+
|
|
437
463
|
### Questions solved using god() function
|
|
438
464
|
|
|
439
465
|
#### Code
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
from .base import *
|
|
2
|
+
from .fraction import fraction
|
|
3
|
+
from .simplify import simplify
|
|
4
|
+
from .trig import trig0
|
|
5
|
+
import itertools
|
|
6
|
+
from .inverse import inverse
|
|
7
|
+
from .formula_data import compile_formula
|
|
8
|
+
from .expand import expand
|
|
9
|
+
from .parser import parse
|
|
10
|
+
def solve_graphics(Ax, Ay, Az, Bx, By, Bz, BAx, BAy, BAz, phi, theta, fvl, tvl, length):
|
|
11
|
+
eq1 = TreeNode("f_eq", [TreeNode("v_6"), TreeNode("v_3")-TreeNode("v_0")])
|
|
12
|
+
eq2 = TreeNode("f_eq", [TreeNode("v_7"), TreeNode("v_4")-TreeNode("v_1")])
|
|
13
|
+
eq3 = TreeNode("f_eq", [TreeNode("v_8"), TreeNode("v_5")-TreeNode("v_2")])
|
|
14
|
+
eq4 = TreeNode("f_eq", [TreeNode("v_6"), TreeNode("v_9").fx("sin")*TreeNode("v_13")])
|
|
15
|
+
eq5 = TreeNode("f_eq", [TreeNode("v_7"), TreeNode("v_10").fx("sin")*TreeNode("v_13")])
|
|
16
|
+
eq6 = TreeNode("f_eq", [TreeNode("v_8"), (TreeNode("d_1") - TreeNode("v_9").fx("sin")**2 - TreeNode("v_10").fx("sin")**2).fx("sqrt")*TreeNode("v_13")])
|
|
17
|
+
eq7 = TreeNode("f_eq", [TreeNode("v_12")**2, (TreeNode("v_3")-TreeNode("v_0"))**2+(TreeNode("v_5")-TreeNode("v_2"))**2])
|
|
18
|
+
eq8 = TreeNode("f_eq", [TreeNode("v_11")**2, (TreeNode("v_4")-TreeNode("v_1"))**2+(TreeNode("v_5")-TreeNode("v_2"))**2])
|
|
19
|
+
q = operation("f_and", [eq1, eq2, eq3, eq4, eq5, eq6, eq7, eq8])
|
|
20
|
+
lst = [Ax, Ay, Az, Bx, By, Bz, BAx, BAy, BAz, phi, theta, fvl, tvl, length]
|
|
21
|
+
name = "Ax Ay Az Bx By Bz Bx-Ax By-Ay Bz-Az inclination_with_VP inclination_with_HP front_view_length top_view_length line_length".split(" ")
|
|
22
|
+
lst_map = {}
|
|
23
|
+
for index, item in enumerate(lst):
|
|
24
|
+
lst_map[index] = item
|
|
25
|
+
solution = {}
|
|
26
|
+
for i in range(len(lst_map.keys())):
|
|
27
|
+
if lst_map[i] is not None:
|
|
28
|
+
solution[f"v_{i}"] = lst_map[i]
|
|
29
|
+
done = True
|
|
30
|
+
fx = compile_formula("sin(x)^2 1-cos(x)^2 _ _ _ _ _ _ _ 2")
|
|
31
|
+
q = simplify(q)
|
|
32
|
+
while done:
|
|
33
|
+
done = False
|
|
34
|
+
for i in range(len(q.children)):
|
|
35
|
+
item = q.children[i]
|
|
36
|
+
for key, item2 in solution.items():
|
|
37
|
+
item = replace(item, TreeNode(key), item2)
|
|
38
|
+
item = fraction(expand(trig0(simplify(item))))
|
|
39
|
+
q.children[i] = item
|
|
40
|
+
if len(vlist(item)) == 1:
|
|
41
|
+
solution[vlist(item)[0]] = inverse(
|
|
42
|
+
item.children[0], vlist(item)[0]
|
|
43
|
+
)
|
|
44
|
+
done = True
|
|
45
|
+
break
|
|
46
|
+
if done:
|
|
47
|
+
continue
|
|
48
|
+
for i in range(len(name)):
|
|
49
|
+
solution[name[i]] = simplify(expand(fx(solution[f"v_{i}"])))
|
|
50
|
+
del solution[f"v_{i}"]
|
|
51
|
+
return solution
|
|
52
|
+
def solve_graphics_string(s):
|
|
53
|
+
s = [None if item == "None" else parse(item) for item in s.split(" ")]
|
|
54
|
+
for key, item in solve_graphics(*s).items():
|
|
55
|
+
print(key, ":", item)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mathai
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.3
|
|
4
4
|
Summary: Mathematics solving Ai tailored to NCERT
|
|
5
5
|
Home-page: https://github.com/infinity390/mathai
|
|
6
6
|
Requires-Python: >=3.7
|
|
@@ -450,6 +450,32 @@ done
|
|
|
450
450
|
8.66474543707973
|
|
451
451
|
```
|
|
452
452
|
|
|
453
|
+
#### Example Demonstration 11 (engineering graphics)
|
|
454
|
+
```python
|
|
455
|
+
from mathai import *
|
|
456
|
+
# (z,y) is dash, a'b' is front view
|
|
457
|
+
# (z,-x) is no dash, ab is top view
|
|
458
|
+
solve_graphics_string("30 20 0 None None None None None None 0 40*pi/180 None None 60")
|
|
459
|
+
```
|
|
460
|
+
|
|
461
|
+
#### Output
|
|
462
|
+
```
|
|
463
|
+
Ax : 30
|
|
464
|
+
Ay : 20
|
|
465
|
+
Az : 0
|
|
466
|
+
Bx : 30
|
|
467
|
+
By : 20+(60*sin(((2*pi)/9)))
|
|
468
|
+
Bz : 60*abs(cos(((2*pi)/9)))
|
|
469
|
+
Bx-Ax : 0
|
|
470
|
+
By-Ay : 60*sin(((2*pi)/9))
|
|
471
|
+
Bz-Az : 60*abs(cos(((2*pi)/9)))
|
|
472
|
+
inclination_with_VP : 0
|
|
473
|
+
inclination_with_HP : (2*pi)/9
|
|
474
|
+
front_view_length : 60
|
|
475
|
+
top_view_length : 60*abs(cos(((2*pi)/9)))
|
|
476
|
+
line_length : 60
|
|
477
|
+
```
|
|
478
|
+
|
|
453
479
|
### Questions solved using god() function
|
|
454
480
|
|
|
455
481
|
#### Code
|
|
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
|
|
|
2
2
|
from pathlib import Path
|
|
3
3
|
setup(
|
|
4
4
|
name="mathai",
|
|
5
|
-
version="2.2.
|
|
5
|
+
version="2.2.3",
|
|
6
6
|
description="Mathematics solving Ai tailored to NCERT",
|
|
7
7
|
long_description=Path("README.md").read_text(encoding="utf-8"),
|
|
8
8
|
long_description_content_type="text/markdown",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|