mathai 2.3.4__tar.gz → 2.3.5__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.
Files changed (39) hide show
  1. {mathai-2.3.4 → mathai-2.3.5}/PKG-INFO +1 -1
  2. {mathai-2.3.4 → mathai-2.3.5}/mathai/__init__.py +2 -0
  3. {mathai-2.3.4 → mathai-2.3.5}/mathai/graphics.py +52 -1
  4. {mathai-2.3.4 → mathai-2.3.5}/mathai.egg-info/PKG-INFO +1 -1
  5. {mathai-2.3.4 → mathai-2.3.5}/setup.py +1 -1
  6. {mathai-2.3.4 → mathai-2.3.5}/README.md +0 -0
  7. {mathai-2.3.4 → mathai-2.3.5}/mathai/apart.py +0 -0
  8. {mathai-2.3.4 → mathai-2.3.5}/mathai/base.py +0 -0
  9. {mathai-2.3.4 → mathai-2.3.5}/mathai/decision.py +0 -0
  10. {mathai-2.3.4 → mathai-2.3.5}/mathai/diff.py +0 -0
  11. {mathai-2.3.4 → mathai-2.3.5}/mathai/electronic.py +0 -0
  12. {mathai-2.3.4 → mathai-2.3.5}/mathai/expand.py +0 -0
  13. {mathai-2.3.4 → mathai-2.3.5}/mathai/factor.py +0 -0
  14. {mathai-2.3.4 → mathai-2.3.5}/mathai/formula_applier.py +0 -0
  15. {mathai-2.3.4 → mathai-2.3.5}/mathai/fraction.py +0 -0
  16. {mathai-2.3.4 → mathai-2.3.5}/mathai/integrate.py +0 -0
  17. {mathai-2.3.4 → mathai-2.3.5}/mathai/inverse.py +0 -0
  18. {mathai-2.3.4 → mathai-2.3.5}/mathai/lambda_calculus.py +0 -0
  19. {mathai-2.3.4 → mathai-2.3.5}/mathai/limit.py +0 -0
  20. {mathai-2.3.4 → mathai-2.3.5}/mathai/linear.py +0 -0
  21. {mathai-2.3.4 → mathai-2.3.5}/mathai/logic.py +0 -0
  22. {mathai-2.3.4 → mathai-2.3.5}/mathai/matrix.py +0 -0
  23. {mathai-2.3.4 → mathai-2.3.5}/mathai/ml.py +0 -0
  24. {mathai-2.3.4 → mathai-2.3.5}/mathai/mlscalar.py +0 -0
  25. {mathai-2.3.4 → mathai-2.3.5}/mathai/ode.py +0 -0
  26. {mathai-2.3.4 → mathai-2.3.5}/mathai/parser.py +0 -0
  27. {mathai-2.3.4 → mathai-2.3.5}/mathai/pde.py +0 -0
  28. {mathai-2.3.4 → mathai-2.3.5}/mathai/printeq.py +0 -0
  29. {mathai-2.3.4 → mathai-2.3.5}/mathai/qm.py +0 -0
  30. {mathai-2.3.4 → mathai-2.3.5}/mathai/simplify.py +0 -0
  31. {mathai-2.3.4 → mathai-2.3.5}/mathai/statistics.py +0 -0
  32. {mathai-2.3.4 → mathai-2.3.5}/mathai/test.py +0 -0
  33. {mathai-2.3.4 → mathai-2.3.5}/mathai/tool.py +0 -0
  34. {mathai-2.3.4 → mathai-2.3.5}/mathai/trig.py +0 -0
  35. {mathai-2.3.4 → mathai-2.3.5}/mathai/univariate_inequality.py +0 -0
  36. {mathai-2.3.4 → mathai-2.3.5}/mathai.egg-info/SOURCES.txt +0 -0
  37. {mathai-2.3.4 → mathai-2.3.5}/mathai.egg-info/dependency_links.txt +0 -0
  38. {mathai-2.3.4 → mathai-2.3.5}/mathai.egg-info/top_level.txt +0 -0
  39. {mathai-2.3.4 → mathai-2.3.5}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mathai
3
- Version: 2.3.4
3
+ Version: 2.3.5
4
4
  Summary: Mathematics solving Ai tailored to NCERT
5
5
  Home-page: https://github.com/infinity390/mathai
6
6
  Requires-Python: >=3.7
@@ -5,6 +5,8 @@ from .pde import solve_pde
5
5
 
6
6
  from .qm import hydrogen_gse, helium_gse, power_rule
7
7
 
8
+ from .graphics import draw_graphics_from_solution
9
+
8
10
  from .lambda_calculus import lambda_expand, lambda_compress, lambda_reduce
9
11
 
10
12
  from .electronic import Edge, CircuitGraph, find_resistance
@@ -46,5 +46,56 @@ def solve_graphics(Ax, Ay, Az, Bx, By, Bz, BAx, BAy, BAz, phi, theta, fvl, tvl,
46
46
  return final_solution
47
47
  def solve_graphics_string(s):
48
48
  s_parsed = [None if item == "None" else parse(item) for item in s.split()]
49
- for key, item in solve_graphics(*s_parsed).items():
49
+ solution = solve_graphics(*s_parsed)
50
+ for key, item in solution.items():
50
51
  print(f"{key} : {item}")
52
+ return solution
53
+ def draw_graphics_from_solution(solution):
54
+ import matplotlib.pyplot as plt
55
+ import numpy as np
56
+ def get_val(key):
57
+ if key in solution:
58
+ val = solution[key]
59
+ try:
60
+ return float(compute(val))
61
+ except Exception:
62
+ try:
63
+ return float(str(val))
64
+ except Exception:
65
+ return 0.0
66
+ return 0.0
67
+ Ax = get_val('Ax')
68
+ Ay = get_val('Ay')
69
+ Az = get_val('Az')
70
+ Bx = get_val('Bx')
71
+ By = get_val('By')
72
+ Bz = get_val('Bz')
73
+ fa_x, fa_y = Az, Ay
74
+ fb_x, fb_y = Bz, By
75
+ ta_x, ta_y = Az, -Ax
76
+ tb_x, tb_y = Bz, -Bx
77
+ fig, ax = plt.subplots(figsize=(9, 7))
78
+ x_min = min(fa_x, fb_x, ta_x, tb_x) - 25
79
+ x_max = max(fa_x, fb_x, ta_x, tb_x) + 25
80
+ ax.axhline(0, color='black', linewidth=1.5, label='Reference Axis')
81
+ ax.plot([fa_x, fb_x], [fa_y, fb_y], 'r-', linewidth=2, label="Front View (a' b')")
82
+ ax.plot(fa_x, fa_y, 'ro', markersize=5)
83
+ ax.plot(fb_x, fb_y, 'ro', markersize=5)
84
+ ax.text(fa_x - 3, fa_y + 3, "a'", fontsize=11, color='red', fontweight='bold')
85
+ ax.text(fb_x + 3, fb_y + 3, "b'", fontsize=11, color='red', fontweight='bold')
86
+ ax.plot([ta_x, tb_x], [ta_y, tb_y], 'b-', linewidth=2, label="Top View (a b)")
87
+ ax.plot(ta_x, ta_y, 'bo', markersize=5)
88
+ ax.plot(tb_x, tb_y, 'bo', markersize=5)
89
+ ax.text(ta_x - 3, ta_y - 8, "a", fontsize=11, color='blue', fontweight='bold')
90
+ ax.text(tb_x + 3, tb_y - 8, "b", fontsize=11, color='blue', fontweight='bold')
91
+ ax.plot([fa_x, ta_x], [fa_y, ta_y], 'k--', alpha=0.5)
92
+ ax.plot([fb_x, tb_x], [fb_y, tb_y], 'k--', alpha=0.5)
93
+ ax.set_aspect('equal', adjustable='datalim')
94
+ ax.grid(True, linestyle=':', alpha=0.6)
95
+ ax.set_xlabel('Coordinate Axis (Az / Bz)', fontsize=10)
96
+ ax.set_ylabel('Height / Depth', fontsize=10)
97
+ ax.set_title('Engineering Drawing: Projections of a Line', fontsize=13, fontweight='bold', pad=15)
98
+ ax.legend(loc='upper right', framealpha=0.9)
99
+ plt.tight_layout()
100
+ plt.savefig('line_projections.png', dpi=300)
101
+ plt.show()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mathai
3
- Version: 2.3.4
3
+ Version: 2.3.5
4
4
  Summary: Mathematics solving Ai tailored to NCERT
5
5
  Home-page: https://github.com/infinity390/mathai
6
6
  Requires-Python: >=3.7
@@ -3,7 +3,7 @@ from setuptools import setup, find_packages
3
3
 
4
4
  setup(
5
5
  name="mathai",
6
- version="2.3.4",
6
+ version="2.3.5",
7
7
  description="Mathematics solving Ai tailored to NCERT",
8
8
  long_description=Path("README.md").read_text(encoding="utf-8"),
9
9
  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