Skip to content
Snippets Groups Projects
Commit 5b9a7f5e authored by Diego Rey's avatar Diego Rey
Browse files

Merge branch 'feature/integration-graph-2d-3d' of...

Merge branch 'feature/integration-graph-2d-3d' of gitlab.fing.edu.uy:matefun/Frontend into feature/integration-graph-2d-3d
parents aa6c7b6c eb41f32c
No related branches found
No related tags found
No related merge requests found
...@@ -45,13 +45,13 @@ export class Graph2DComponent { ...@@ -45,13 +45,13 @@ export class Graph2DComponent {
//Para las funciones //Para las funciones
if (obj.conj.sets.fdom == "function(x)") { if (obj.conj.sets.fdom == "function(x)") {
var nom = jsonCanvas.funs[0].dom; var nom = jsonCanvas.funs[0].dom;
var elemento = this.recursionfuncion(jsonCanvas.funs[0].sets, nom); var elemento1 = this.recursionfuncion(jsonCanvas.funs[0].sets, nom);
obj.conj.sets.fdom = function (x) { return eval(elemento) } obj.conj.sets.fdom = function (x) { return eval(elemento1) }
} }
if (obj.conj.sets.fcod == "function(x)") { if (obj.conj.sets.fcod == "function(x)") {
var nom = jsonCanvas.funs[0].cod; var nom = jsonCanvas.funs[0].cod;
var elemento = this.recursionfuncion(jsonCanvas.funs[0].sets, nom); var elemento2 = this.recursionfuncion(jsonCanvas.funs[0].sets, nom);
obj.conj.sets.fcod = function (x) { return (eval(elemento)) } obj.conj.sets.fcod = function (x) { return (eval(elemento2)) }
} }
//para Enumerados //para Enumerados
if (obj.conj.dom == 'Numer') { if (obj.conj.dom == 'Numer') {
...@@ -476,7 +476,7 @@ export class Graph2DComponent { ...@@ -476,7 +476,7 @@ export class Graph2DComponent {
grafica = fun; grafica = fun;
} }
} }
funcionString = '(' + grafica.args.join() + ',delta,hayPunto)=>{\n' + funcionString + '}'; funcionString = '(' + grafica.args.join() + ')=>{\n' + funcionString + '}';
return funcionString; return funcionString;
} }
...@@ -487,9 +487,9 @@ export class Graph2DComponent { ...@@ -487,9 +487,9 @@ export class Graph2DComponent {
expresion = ' (' + this.generarExpresion(exp.cond) + '?' + this.generarExpresion(exp.exp1) + ':' + this.generarExpresion(exp.exp2) + ') '; expresion = ' (' + this.generarExpresion(exp.cond) + '?' + this.generarExpresion(exp.exp1) + ':' + this.generarExpresion(exp.exp2) + ') ';
} else if (exp.kind == 'bop') { } else if (exp.kind == 'bop') {
if (exp.op == '==') { if (exp.op == '==') {
expresion = ' Math.abs((' + this.generarExpresion(exp.exp1) + ') - (' + this.generarExpresion(exp.exp2) + ')) < delta && hayPunto() '; expresion = ' Math.abs((' + this.generarExpresion(exp.exp1) + ') - (' + this.generarExpresion(exp.exp2) + ')) == 0 ';
} else if (exp.op == '/=') { } else if (exp.op == '/=') {
expresion = ' Math.abs((' + this.generarExpresion(exp.exp1) + ') - (' + this.generarExpresion(exp.exp2) + ')) > delta || Math.abs((' + this.generarExpresion(exp.exp1) + ') - (' + this.generarExpresion(exp.exp2) + ')) < delta && !hayPunto() '; expresion = ' Math.abs((' + this.generarExpresion(exp.exp1) + ') - (' + this.generarExpresion(exp.exp2) + ')) == 0 || Math.abs((' + this.generarExpresion(exp.exp1) + ') - (' + this.generarExpresion(exp.exp2) + ')) == 0 ';
} else if (exp.op == '^') { } else if (exp.op == '^') {
expresion = ' Math.pow(' + this.generarExpresion(exp.exp1) + ',' + this.generarExpresion(exp.exp2) + ') '; expresion = ' Math.pow(' + this.generarExpresion(exp.exp1) + ',' + this.generarExpresion(exp.exp2) + ') ';
} else { } else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment