this.reset();
this.applyDeclarations(code);
String codeWithoutDeclarations = this.getCodeWithoutDeclarations(code);
this.calcCode = codeWithoutDeclarations.substring(5);
Funktion f = new Funktion();
f = f.convertStoFunk(this.calcCode);
this.calcCode = f.wohlgeklammertLaTeX(this.calcCode, 0);
this.calcCode = this.calcCode.replaceAll("\\(", "{\\\\left(");
this.calcCode = this.calcCode.replaceAll("\\)", "\\\\right)}");
this.calcCode = this.calcCode.replace("*", "\\cdot ") + "=";
if (this.alwaysShowCompleteTable || this.calcCode.contains("x") || this.calcCode.contains("y")) {
if (!alwaysShowCompleteTable) {
if (!this.calcCode.contains("x")) {
this.xMax = this.xMin;
}
if (!this.calcCode.contains("y")) {
this.yMax = this.yMin;
}
}
String cols = "|c||";
for (double y = yMin; y <= yMax; y += (yMax - yMin + 1) / yNum) {
cols += "c|";
}
this.calcCode += "\n\\\\\\mbox{\\begin{tabular}{" + cols + "}\n";
this.calcCode += "\\hline\n";
this.calcCode += "$x\\backslash y$ ";
for (double y = yMin; y <= yMax; y += (yMax - yMin + 1) / yNum) {
this.calcCode += " & $" + StaticMethods.round(y, this.roundDigits) + "$";
}
this.calcCode += "\\\\\\hline\\hline\n";
for (double x = xMin; x <= xMax; x += (xMax - xMin + 1) / xNum) {
this.calcCode += "$" + StaticMethods.round(x, this.roundDigits) + "$";
for (double y = yMin; y <= yMax; y += (yMax - yMin + 1) / yNum) {
this.calcCode += " & $" + StaticMethods.round(f.eval(x, y), this.roundDigits) + "$";
}
this.calcCode += "\\\\\\hline\n";
}
this.calcCode += "\\end{tabular}}";
} else {
this.eval = f.eval(0, 0) + "";
this.calcCode += this.eval;
}
}