-
Notifications
You must be signed in to change notification settings - Fork 0
/
ecuaciones.py
55 lines (42 loc) · 1.45 KB
/
ecuaciones.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
from sympy import *
from sympy.abc import x
import sympy
from algebreb.listas.listas_ecuaciones_univariables import ListaEcuacionesGrado1, ListaEcuacionesGrado2
def lista_grado1(json):
caracteristicas = {}
cant = json['cantidad']
variables = json['variables']
dominio = json['dominio']
fraccion = json['fraccion']
cmin = json['cmin']
cmax = json['cmax']
vars_as_symbols = [sympy.symbols(v) for v in variables]
caracteristicas = {}
caracteristicas['cantidad'] = cant
caracteristicas['variables'] = vars_as_symbols
caracteristicas['fraccion'] = fraccion
caracteristicas['dominio'] = dominio
caracteristicas['cmin'] = cmin
caracteristicas['cmax'] = cmax
lbc = ListaEcuacionesGrado1(caracteristicas)
lista_dicc = lbc.as_str_latex()
return lista_dicc
def lista_grado2(json):
caracteristicas = {}
cant = json['cantidad']
variables = json['variables']
dominio = json['dominio']
fraccion = json['fraccion']
cmin = json['cmin']
cmax = json['cmax']
vars_as_symbols = [sympy.symbols(v) for v in variables]
caracteristicas = {}
caracteristicas['cantidad'] = cant
caracteristicas['variables'] = vars_as_symbols
caracteristicas['fraccion'] = fraccion
caracteristicas['dominio'] = dominio
caracteristicas['cmin'] = cmin
caracteristicas['cmax'] = cmax
lbc = ListaEcuacionesGrado2(caracteristicas)
lista_dicc = lbc.as_str_latex()
return lista_dicc