mathai 2.2.3__tar.gz → 2.2.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 (57) hide show
  1. {mathai-2.2.3 → mathai-2.2.5}/PKG-INFO +76 -4
  2. {mathai-2.2.3 → mathai-2.2.5}/README.md +75 -3
  3. {mathai-2.2.3 → mathai-2.2.5}/mathai/graphics.py +25 -30
  4. {mathai-2.2.3 → mathai-2.2.5}/mathai/inverse.py +24 -13
  5. {mathai-2.2.3 → mathai-2.2.5}/mathai.egg-info/PKG-INFO +76 -4
  6. {mathai-2.2.3 → mathai-2.2.5}/setup.py +1 -1
  7. {mathai-2.2.3 → mathai-2.2.5}/mathai/__init__.py +0 -0
  8. {mathai-2.2.3 → mathai-2.2.5}/mathai/apart.py +0 -0
  9. {mathai-2.2.3 → mathai-2.2.5}/mathai/base.py +0 -0
  10. {mathai-2.2.3 → mathai-2.2.5}/mathai/decision.py +0 -0
  11. {mathai-2.2.3 → mathai-2.2.5}/mathai/diff.py +0 -0
  12. {mathai-2.2.3 → mathai-2.2.5}/mathai/electronic.py +0 -0
  13. {mathai-2.2.3 → mathai-2.2.5}/mathai/expand.py +0 -0
  14. {mathai-2.2.3 → mathai-2.2.5}/mathai/factor.py +0 -0
  15. {mathai-2.2.3 → mathai-2.2.5}/mathai/formula/differentiation.marshal +0 -0
  16. {mathai-2.2.3 → mathai-2.2.5}/mathai/formula/integration.marshal +0 -0
  17. {mathai-2.2.3 → mathai-2.2.5}/mathai/formula/integration_trig.marshal +0 -0
  18. {mathai-2.2.3 → mathai-2.2.5}/mathai/formula/is_integrate_subs.marshal +0 -0
  19. {mathai-2.2.3 → mathai-2.2.5}/mathai/formula/lambda_compress.marshal +0 -0
  20. {mathai-2.2.3 → mathai-2.2.5}/mathai/formula/lambda_expand.marshal +0 -0
  21. {mathai-2.2.3 → mathai-2.2.5}/mathai/formula/lambda_reduce.marshal +0 -0
  22. {mathai-2.2.3 → mathai-2.2.5}/mathai/formula/limit_infinity.marshal +0 -0
  23. {mathai-2.2.3 → mathai-2.2.5}/mathai/formula/matrix_vectorization_calculus.marshal +0 -0
  24. {mathai-2.2.3 → mathai-2.2.5}/mathai/formula/power_rule.marshal +0 -0
  25. {mathai-2.2.3 → mathai-2.2.5}/mathai/formula/quadratic.marshal +0 -0
  26. {mathai-2.2.3 → mathai-2.2.5}/mathai/formula/statistics_1.marshal +0 -0
  27. {mathai-2.2.3 → mathai-2.2.5}/mathai/formula/statistics_2.marshal +0 -0
  28. {mathai-2.2.3 → mathai-2.2.5}/mathai/formula/test.marshal +0 -0
  29. {mathai-2.2.3 → mathai-2.2.5}/mathai/formula/trigonometry_misc.marshal +0 -0
  30. {mathai-2.2.3 → mathai-2.2.5}/mathai/formula_compiler.py +0 -0
  31. {mathai-2.2.3 → mathai-2.2.5}/mathai/formula_data.py +0 -0
  32. {mathai-2.2.3 → mathai-2.2.5}/mathai/formula_interpretor.py +0 -0
  33. {mathai-2.2.3 → mathai-2.2.5}/mathai/fraction.py +0 -0
  34. {mathai-2.2.3 → mathai-2.2.5}/mathai/integrate.py +0 -0
  35. {mathai-2.2.3 → mathai-2.2.5}/mathai/lambda_calculus.py +0 -0
  36. {mathai-2.2.3 → mathai-2.2.5}/mathai/limit.py +0 -0
  37. {mathai-2.2.3 → mathai-2.2.5}/mathai/linear.py +0 -0
  38. {mathai-2.2.3 → mathai-2.2.5}/mathai/logic.py +0 -0
  39. {mathai-2.2.3 → mathai-2.2.5}/mathai/matrix.py +0 -0
  40. {mathai-2.2.3 → mathai-2.2.5}/mathai/ml.py +0 -0
  41. {mathai-2.2.3 → mathai-2.2.5}/mathai/mlscalar.py +0 -0
  42. {mathai-2.2.3 → mathai-2.2.5}/mathai/ode.py +0 -0
  43. {mathai-2.2.3 → mathai-2.2.5}/mathai/parser.py +0 -0
  44. {mathai-2.2.3 → mathai-2.2.5}/mathai/pde.py +0 -0
  45. {mathai-2.2.3 → mathai-2.2.5}/mathai/printeq.py +0 -0
  46. {mathai-2.2.3 → mathai-2.2.5}/mathai/qm.py +0 -0
  47. {mathai-2.2.3 → mathai-2.2.5}/mathai/simplify.py +0 -0
  48. {mathai-2.2.3 → mathai-2.2.5}/mathai/statistics.py +0 -0
  49. {mathai-2.2.3 → mathai-2.2.5}/mathai/test.py +0 -0
  50. {mathai-2.2.3 → mathai-2.2.5}/mathai/tool.py +0 -0
  51. {mathai-2.2.3 → mathai-2.2.5}/mathai/trig.py +0 -0
  52. {mathai-2.2.3 → mathai-2.2.5}/mathai/univariate_inequality.py +0 -0
  53. {mathai-2.2.3 → mathai-2.2.5}/mathai.egg-info/SOURCES.txt +0 -0
  54. {mathai-2.2.3 → mathai-2.2.5}/mathai.egg-info/dependency_links.txt +0 -0
  55. {mathai-2.2.3 → mathai-2.2.5}/mathai.egg-info/requires.txt +0 -0
  56. {mathai-2.2.3 → mathai-2.2.5}/mathai.egg-info/top_level.txt +0 -0
  57. {mathai-2.2.3 → mathai-2.2.5}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mathai
3
- Version: 2.2.3
3
+ Version: 2.2.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
@@ -455,7 +455,19 @@ done
455
455
  from mathai import *
456
456
  # (z,y) is dash, a'b' is front view
457
457
  # (z,-x) is no dash, ab is top view
458
+
459
+ # A line AB 60 mm long has its end A 20 mm above HP and 30 mm infront of VP. The line is inclined at 40 degrees to HP and is parallel to VP. Draw the projection
458
460
  solve_graphics_string("30 20 0 None None None None None None 0 40*pi/180 None None 60")
461
+ print()
462
+
463
+ # Engineering Graphics for DEGREE P.I. Varghese
464
+ solve_graphics_string("20 25 0 None None None None None None 30*pi/180 0 60 None None") # 11.14
465
+ print()
466
+ solve_graphics_string("15 25 0 None None None None None None 30*pi/180 0 50 None None") # 11.15
467
+ print()
468
+ solve_graphics_string("0 -25 0 None None None None None None None 0 55 None 75") # 11.17
469
+ print()
470
+ solve_graphics_string("25 50 0 -30 None None None None None None 0 None None 80") # 11.19
459
471
  ```
460
472
 
461
473
  #### Output
@@ -465,15 +477,75 @@ Ay : 20
465
477
  Az : 0
466
478
  Bx : 30
467
479
  By : 20+(60*sin(((2*pi)/9)))
468
- Bz : 60*abs(cos(((2*pi)/9)))
480
+ Bz : 60*sqrt((1-(sin(((2*pi)/9))^2)))
469
481
  Bx-Ax : 0
470
482
  By-Ay : 60*sin(((2*pi)/9))
471
- Bz-Az : 60*abs(cos(((2*pi)/9)))
483
+ Bz-Az : 60*sqrt((1-(sin(((2*pi)/9))^2)))
472
484
  inclination_with_VP : 0
473
485
  inclination_with_HP : (2*pi)/9
474
486
  front_view_length : 60
475
- top_view_length : 60*abs(cos(((2*pi)/9)))
487
+ top_view_length : sqrt((3600-(3600*(sin(((2*pi)/9))^2))))
476
488
  line_length : 60
489
+
490
+ Ax : 20
491
+ Ay : 25
492
+ Az : 0
493
+ Bx : 20+(60/(3^-(-1/2)))
494
+ By : 25
495
+ Bz : 60
496
+ Bx-Ax : 60/(3^-(-1/2))
497
+ By-Ay : 0
498
+ Bz-Az : 60
499
+ inclination_with_VP : pi/6
500
+ inclination_with_HP : 0
501
+ front_view_length : 60
502
+ top_view_length : sqrt(4800)
503
+ line_length : 120/(3^-(-1/2))
504
+
505
+ Ax : 15
506
+ Ay : 25
507
+ Az : 0
508
+ Bx : 15+(50/(3^-(-1/2)))
509
+ By : 25
510
+ Bz : 50
511
+ Bx-Ax : 50/(3^-(-1/2))
512
+ By-Ay : 0
513
+ Bz-Az : 50
514
+ inclination_with_VP : pi/6
515
+ inclination_with_HP : 0
516
+ front_view_length : 50
517
+ top_view_length : 100/(3^-(-1/2))
518
+ line_length : 100/(3^-(-1/2))
519
+
520
+ Ax : 0
521
+ Ay : -25
522
+ Az : 0
523
+ Bx : 5*sqrt(104)
524
+ By : -25
525
+ Bz : 55
526
+ Bx-Ax : 5*sqrt(104)
527
+ By-Ay : 0
528
+ Bz-Az : 55
529
+ inclination_with_VP : arcsin((sqrt(104)/15))
530
+ inclination_with_HP : 0
531
+ front_view_length : 55
532
+ top_view_length : 75
533
+ line_length : 75
534
+
535
+ Ax : 25
536
+ Ay : 50
537
+ Az : 0
538
+ Bx : -30
539
+ By : 50
540
+ Bz : 5*sqrt(135)
541
+ Bx-Ax : -55
542
+ By-Ay : 0
543
+ Bz-Az : 5*sqrt(135)
544
+ inclination_with_VP : arcsin((-11/16))
545
+ inclination_with_HP : 0
546
+ front_view_length : sqrt(3375)
547
+ top_view_length : 80
548
+ line_length : 80
477
549
  ```
478
550
 
479
551
  ### Questions solved using god() function
@@ -439,7 +439,19 @@ done
439
439
  from mathai import *
440
440
  # (z,y) is dash, a'b' is front view
441
441
  # (z,-x) is no dash, ab is top view
442
+
443
+ # A line AB 60 mm long has its end A 20 mm above HP and 30 mm infront of VP. The line is inclined at 40 degrees to HP and is parallel to VP. Draw the projection
442
444
  solve_graphics_string("30 20 0 None None None None None None 0 40*pi/180 None None 60")
445
+ print()
446
+
447
+ # Engineering Graphics for DEGREE P.I. Varghese
448
+ solve_graphics_string("20 25 0 None None None None None None 30*pi/180 0 60 None None") # 11.14
449
+ print()
450
+ solve_graphics_string("15 25 0 None None None None None None 30*pi/180 0 50 None None") # 11.15
451
+ print()
452
+ solve_graphics_string("0 -25 0 None None None None None None None 0 55 None 75") # 11.17
453
+ print()
454
+ solve_graphics_string("25 50 0 -30 None None None None None None 0 None None 80") # 11.19
443
455
  ```
444
456
 
445
457
  #### Output
@@ -449,15 +461,75 @@ Ay : 20
449
461
  Az : 0
450
462
  Bx : 30
451
463
  By : 20+(60*sin(((2*pi)/9)))
452
- Bz : 60*abs(cos(((2*pi)/9)))
464
+ Bz : 60*sqrt((1-(sin(((2*pi)/9))^2)))
453
465
  Bx-Ax : 0
454
466
  By-Ay : 60*sin(((2*pi)/9))
455
- Bz-Az : 60*abs(cos(((2*pi)/9)))
467
+ Bz-Az : 60*sqrt((1-(sin(((2*pi)/9))^2)))
456
468
  inclination_with_VP : 0
457
469
  inclination_with_HP : (2*pi)/9
458
470
  front_view_length : 60
459
- top_view_length : 60*abs(cos(((2*pi)/9)))
471
+ top_view_length : sqrt((3600-(3600*(sin(((2*pi)/9))^2))))
460
472
  line_length : 60
473
+
474
+ Ax : 20
475
+ Ay : 25
476
+ Az : 0
477
+ Bx : 20+(60/(3^-(-1/2)))
478
+ By : 25
479
+ Bz : 60
480
+ Bx-Ax : 60/(3^-(-1/2))
481
+ By-Ay : 0
482
+ Bz-Az : 60
483
+ inclination_with_VP : pi/6
484
+ inclination_with_HP : 0
485
+ front_view_length : 60
486
+ top_view_length : sqrt(4800)
487
+ line_length : 120/(3^-(-1/2))
488
+
489
+ Ax : 15
490
+ Ay : 25
491
+ Az : 0
492
+ Bx : 15+(50/(3^-(-1/2)))
493
+ By : 25
494
+ Bz : 50
495
+ Bx-Ax : 50/(3^-(-1/2))
496
+ By-Ay : 0
497
+ Bz-Az : 50
498
+ inclination_with_VP : pi/6
499
+ inclination_with_HP : 0
500
+ front_view_length : 50
501
+ top_view_length : 100/(3^-(-1/2))
502
+ line_length : 100/(3^-(-1/2))
503
+
504
+ Ax : 0
505
+ Ay : -25
506
+ Az : 0
507
+ Bx : 5*sqrt(104)
508
+ By : -25
509
+ Bz : 55
510
+ Bx-Ax : 5*sqrt(104)
511
+ By-Ay : 0
512
+ Bz-Az : 55
513
+ inclination_with_VP : arcsin((sqrt(104)/15))
514
+ inclination_with_HP : 0
515
+ front_view_length : 55
516
+ top_view_length : 75
517
+ line_length : 75
518
+
519
+ Ax : 25
520
+ Ay : 50
521
+ Az : 0
522
+ Bx : -30
523
+ By : 50
524
+ Bz : 5*sqrt(135)
525
+ Bx-Ax : -55
526
+ By-Ay : 0
527
+ Bz-Az : 5*sqrt(135)
528
+ inclination_with_VP : arcsin((-11/16))
529
+ inclination_with_HP : 0
530
+ front_view_length : sqrt(3375)
531
+ top_view_length : 80
532
+ line_length : 80
461
533
  ```
462
534
 
463
535
  ### Questions solved using god() function
@@ -4,31 +4,26 @@ from .simplify import simplify
4
4
  from .trig import trig0
5
5
  import itertools
6
6
  from .inverse import inverse
7
- from .formula_data import compile_formula
8
7
  from .expand import expand
9
8
  from .parser import parse
10
9
  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])
10
+ eq1 = TreeNode("f_eq", [TreeNode("v_6"), TreeNode("v_3") - TreeNode("v_0")])
11
+ eq2 = TreeNode("f_eq", [TreeNode("v_7"), TreeNode("v_4") - TreeNode("v_1")])
12
+ eq3 = TreeNode("f_eq", [TreeNode("v_8"), TreeNode("v_5") - TreeNode("v_2")])
13
+ eq4 = TreeNode("f_eq", [TreeNode("v_6"), TreeNode("v_9").fx("sin") * TreeNode("v_13")])
14
+ eq5 = TreeNode("f_eq", [TreeNode("v_7"), TreeNode("v_10").fx("sin") * TreeNode("v_13")])
15
+ 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")])
16
+ eq7 = TreeNode("f_eq", [TreeNode("v_12")**2, (TreeNode("v_3") - TreeNode("v_0"))**2 + (TreeNode("v_5") - TreeNode("v_2"))**2])
17
+ eq8 = TreeNode("f_eq", [TreeNode("v_11")**2, (TreeNode("v_4") - TreeNode("v_1"))**2 + (TreeNode("v_5") - TreeNode("v_2"))**2])
19
18
  q = operation("f_and", [eq1, eq2, eq3, eq4, eq5, eq6, eq7, eq8])
20
19
  lst = [Ax, Ay, Az, Bx, By, Bz, BAx, BAy, BAz, phi, theta, fvl, tvl, length]
21
20
  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
21
  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")
22
+ for index, item in enumerate(lst):
23
+ if item is not None:
24
+ solution[f"v_{index}"] = item
31
25
  q = simplify(q)
26
+ done = True
32
27
  while done:
33
28
  done = False
34
29
  for i in range(len(q.children)):
@@ -37,19 +32,19 @@ def solve_graphics(Ax, Ay, Az, Bx, By, Bz, BAx, BAy, BAz, phi, theta, fvl, tvl,
37
32
  item = replace(item, TreeNode(key), item2)
38
33
  item = fraction(expand(trig0(simplify(item))))
39
34
  q.children[i] = item
40
- if len(vlist(item)) == 1:
41
- solution[vlist(item)[0]] = inverse(
42
- item.children[0], vlist(item)[0]
43
- )
35
+ vars_in_item = vlist(item)
36
+ if len(vars_in_item) == 1:
37
+ target_var = vars_in_item[0]
38
+ solution[target_var] = inverse(item.children[0], target_var)
44
39
  done = True
45
40
  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
41
+ final_solution = {}
42
+ for i, param_name in enumerate(name):
43
+ var_key = f"v_{i}"
44
+ if var_key in solution:
45
+ final_solution[param_name] = simplify(expand(solution[var_key]))
46
+ return final_solution
52
47
  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)
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():
50
+ print(f"{key} : {item}")
@@ -1,23 +1,25 @@
1
1
  from .base import *
2
2
  from .simplify import simplify
3
3
  from .expand import expand
4
- def inverse(rhs,term, sign=None):
4
+ import copy
5
+ def inverse(rhs, term, sign=None):
5
6
  term = tree_form(term)
6
7
  lhs = tree_form("d_0")
8
+ rhs = copy.deepcopy(rhs)
7
9
  count = 15
8
- while not rhs==term:
10
+ while not rhs == term:
9
11
  if rhs.name == "f_add":
10
- if all(term in factor_generation(child) for child in rhs.children):
11
- newrhs = simplify(expand(rhs*term**-1))
12
+ if rhs.children and all(term in factor_generation(child) for child in rhs.children):
13
+ newrhs = simplify(expand(rhs * term**-1))
12
14
  if not contain(newrhs, term):
13
15
  rhs = term * newrhs
14
16
  else:
15
- for i in range(len(rhs.children)-1,-1,-1):
17
+ for i in range(len(rhs.children) - 1, -1, -1):
16
18
  if not contain(rhs.children[i], term):
17
19
  lhs = lhs - rhs.children[i]
18
20
  rhs.children.pop(i)
19
21
  elif rhs.name == "f_mul":
20
- for i in range(len(rhs.children)-1,-1,-1):
22
+ for i in range(len(rhs.children) - 1, -1, -1):
21
23
  if not contain(rhs.children[i], term):
22
24
  lhs = lhs * rhs.children[i]**-1
23
25
  if sign is not None:
@@ -26,11 +28,17 @@ def inverse(rhs,term, sign=None):
26
28
  if compute(rhs.children[i]**-1) < 0:
27
29
  sign = not sign
28
30
  rhs.children.pop(i)
29
- elif rhs.name == "f_pow" and contain(rhs.children[0], term):
30
- lhs = lhs ** (tree_form("d_1")/rhs.children[1])
31
+ elif rhs.name == "f_pow" and contain(rhs.children[0], term) and not contain(rhs.children[1], term):
32
+ lhs = lhs ** (tree_form("d_1") / rhs.children[1])
33
+ if sign is not None:
34
+ if compute(rhs.children[1]) < 0:
35
+ sign = not sign
31
36
  rhs = copy.deepcopy(rhs.children[0])
37
+ elif rhs.name == "f_pow" and rhs.children[0].name == "s_e" and contain(rhs.children[1], term):
38
+ lhs = lhs.fx("log")
39
+ rhs = copy.deepcopy(rhs.children[1])
32
40
  elif rhs.name == "f_pow" and contain(rhs.children[1], term) and not contain(rhs.children[0], term):
33
- lhs = lhs.fx("log")/rhs.children[0].fx("log")
41
+ lhs = lhs.fx("log") / rhs.children[0].fx("log")
34
42
  rhs = copy.deepcopy(rhs.children[1])
35
43
  elif rhs.name == "f_sin" and contain(rhs.children[0], term):
36
44
  lhs = lhs.fx("arcsin")
@@ -40,27 +48,30 @@ def inverse(rhs,term, sign=None):
40
48
  rhs = copy.deepcopy(rhs.children[0])
41
49
  elif rhs.name == "f_arccos" and contain(rhs.children[0], term):
42
50
  lhs = lhs.fx("cos")
51
+ if sign is not None:
52
+ sign = not sign
43
53
  rhs = copy.deepcopy(rhs.children[0])
44
54
  elif rhs.name == "f_cos" and contain(rhs.children[0], term):
45
55
  lhs = lhs.fx("arccos")
56
+ if sign is not None:
57
+ sign = not sign
46
58
  rhs = copy.deepcopy(rhs.children[0])
47
59
  elif rhs.name == "f_log" and contain(rhs.children[0], term):
48
60
  lhs = tree_form("s_e")**lhs
49
61
  rhs = copy.deepcopy(rhs.children[0])
50
- elif rhs.name == "f_pow" and rhs.children[0].name == "s_e" and contain(rhs.children[1], term):
51
- lhs = lhs.fx("log")
52
- rhs = copy.deepcopy(rhs.children[1].fx("log"))
53
62
  elif rhs.name == "f_tan" and contain(rhs.children[0], term):
54
63
  lhs = lhs.fx("arctan")
55
64
  rhs = copy.deepcopy(rhs.children[0])
56
65
  elif rhs.name == "f_arctan" and contain(rhs.children[0], term):
57
66
  lhs = lhs.fx("tan")
58
67
  rhs = copy.deepcopy(rhs.children[0])
59
- if len(rhs.children) == 1:
68
+ if rhs.name in ["f_add", "f_mul"] and len(rhs.children) == 1:
60
69
  rhs = rhs.children[0]
61
70
  count -= 1
62
71
  if count == 0:
63
72
  return None
73
+ if contain(lhs, term):
74
+ return None
64
75
  if sign is None:
65
76
  return simplify(lhs)
66
77
  return simplify(lhs), sign
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mathai
3
- Version: 2.2.3
3
+ Version: 2.2.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
@@ -455,7 +455,19 @@ done
455
455
  from mathai import *
456
456
  # (z,y) is dash, a'b' is front view
457
457
  # (z,-x) is no dash, ab is top view
458
+
459
+ # A line AB 60 mm long has its end A 20 mm above HP and 30 mm infront of VP. The line is inclined at 40 degrees to HP and is parallel to VP. Draw the projection
458
460
  solve_graphics_string("30 20 0 None None None None None None 0 40*pi/180 None None 60")
461
+ print()
462
+
463
+ # Engineering Graphics for DEGREE P.I. Varghese
464
+ solve_graphics_string("20 25 0 None None None None None None 30*pi/180 0 60 None None") # 11.14
465
+ print()
466
+ solve_graphics_string("15 25 0 None None None None None None 30*pi/180 0 50 None None") # 11.15
467
+ print()
468
+ solve_graphics_string("0 -25 0 None None None None None None None 0 55 None 75") # 11.17
469
+ print()
470
+ solve_graphics_string("25 50 0 -30 None None None None None None 0 None None 80") # 11.19
459
471
  ```
460
472
 
461
473
  #### Output
@@ -465,15 +477,75 @@ Ay : 20
465
477
  Az : 0
466
478
  Bx : 30
467
479
  By : 20+(60*sin(((2*pi)/9)))
468
- Bz : 60*abs(cos(((2*pi)/9)))
480
+ Bz : 60*sqrt((1-(sin(((2*pi)/9))^2)))
469
481
  Bx-Ax : 0
470
482
  By-Ay : 60*sin(((2*pi)/9))
471
- Bz-Az : 60*abs(cos(((2*pi)/9)))
483
+ Bz-Az : 60*sqrt((1-(sin(((2*pi)/9))^2)))
472
484
  inclination_with_VP : 0
473
485
  inclination_with_HP : (2*pi)/9
474
486
  front_view_length : 60
475
- top_view_length : 60*abs(cos(((2*pi)/9)))
487
+ top_view_length : sqrt((3600-(3600*(sin(((2*pi)/9))^2))))
476
488
  line_length : 60
489
+
490
+ Ax : 20
491
+ Ay : 25
492
+ Az : 0
493
+ Bx : 20+(60/(3^-(-1/2)))
494
+ By : 25
495
+ Bz : 60
496
+ Bx-Ax : 60/(3^-(-1/2))
497
+ By-Ay : 0
498
+ Bz-Az : 60
499
+ inclination_with_VP : pi/6
500
+ inclination_with_HP : 0
501
+ front_view_length : 60
502
+ top_view_length : sqrt(4800)
503
+ line_length : 120/(3^-(-1/2))
504
+
505
+ Ax : 15
506
+ Ay : 25
507
+ Az : 0
508
+ Bx : 15+(50/(3^-(-1/2)))
509
+ By : 25
510
+ Bz : 50
511
+ Bx-Ax : 50/(3^-(-1/2))
512
+ By-Ay : 0
513
+ Bz-Az : 50
514
+ inclination_with_VP : pi/6
515
+ inclination_with_HP : 0
516
+ front_view_length : 50
517
+ top_view_length : 100/(3^-(-1/2))
518
+ line_length : 100/(3^-(-1/2))
519
+
520
+ Ax : 0
521
+ Ay : -25
522
+ Az : 0
523
+ Bx : 5*sqrt(104)
524
+ By : -25
525
+ Bz : 55
526
+ Bx-Ax : 5*sqrt(104)
527
+ By-Ay : 0
528
+ Bz-Az : 55
529
+ inclination_with_VP : arcsin((sqrt(104)/15))
530
+ inclination_with_HP : 0
531
+ front_view_length : 55
532
+ top_view_length : 75
533
+ line_length : 75
534
+
535
+ Ax : 25
536
+ Ay : 50
537
+ Az : 0
538
+ Bx : -30
539
+ By : 50
540
+ Bz : 5*sqrt(135)
541
+ Bx-Ax : -55
542
+ By-Ay : 0
543
+ Bz-Az : 5*sqrt(135)
544
+ inclination_with_VP : arcsin((-11/16))
545
+ inclination_with_HP : 0
546
+ front_view_length : sqrt(3375)
547
+ top_view_length : 80
548
+ line_length : 80
477
549
  ```
478
550
 
479
551
  ### Questions solved using god() function
@@ -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.3",
5
+ version="2.2.5",
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