From 3039aade295a11c20931f8095a785a2ee74d0833 Mon Sep 17 00:00:00 2001 From: Ad5001 Date: Sun, 8 Oct 2023 16:24:16 +0200 Subject: [PATCH] Fixing some issues with infinity in domains. --- .../qml/eu/ad5001/LogarithmPlotter/js/expr-eval.js | 3 ++- .../qml/eu/ad5001/LogarithmPlotter/js/math/domain.js | 4 ++-- .../qml/eu/ad5001/LogarithmPlotter/js/math/latex.js | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/expr-eval.js b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/expr-eval.js index 6417e83..fdd06eb 100644 --- a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/expr-eval.js +++ b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/expr-eval.js @@ -26,7 +26,8 @@ var ADDITIONAL_VARCHARS = [ "ₕ","ₖ","ₗ","ₘ","ₙ","ₚ","ₛ", "ₜ","¹","²","³","⁴","⁵","⁶", "⁷","⁸","⁹","⁰","₁","₂","₃", - "₄","₅","₆","₇","₈","₉","₀" + "₄","₅","₆","₇","₈","₉","₀", + "∞" ] function Instruction(type, value) { diff --git a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/math/domain.js b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/math/domain.js index 25f04d2..3586bc0 100644 --- a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/math/domain.js +++ b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/math/domain.js @@ -437,8 +437,8 @@ class UnionDomain extends Domain { static import(frm) { var domains = frm.trim().split("∪") if(domains.length == 1) domains = frm.trim().split("U") // Fallback - var dom1 = parseDomain(domains.pop()) - var dom2 = parseDomain(domains.join('∪')) + var dom2 = parseDomain(domains.pop()) + var dom1 = parseDomain(domains.join('∪')) return dom1.union(dom2) } } diff --git a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/math/latex.js b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/math/latex.js index 39461fd..b52a19e 100644 --- a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/math/latex.js +++ b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/math/latex.js @@ -114,7 +114,7 @@ function variable(vari, wrapIn$ = false) { "ₜ","¹","²","³","⁴","⁵","⁶", "⁷","⁸","⁹","⁰","₁","₂","₃", "₄","₅","₆","₇","₈","₉","₀", - "pi"] + "pi", "∞"] let equivalchars = ["\\alpha","\\beta","\\gamma","\\delta","\\epsilon","\\zeta","\\eta", "\\pi","\\theta","\\kappa","\\lambda","\\mu","\\xi","\\rho", "\\sigma","\\sigma","\\tau","\\phi","\\chi","\\psi","\\omega", @@ -124,7 +124,7 @@ function variable(vari, wrapIn$ = false) { "{}_{t}","{}^{1}","{}^{2}","{}^{3}","{}^{4}","{}^{5}","{}^{6}", "{}^{7}","{}^{8}","{}^{9}","{}^{0}","{}_{1}","{}_{2}","{}_{3}", "{}_{4}","{}_{5}","{}_{6}","{}_{7}","{}_{8}","{}_{9}","{}_{0}", - "\\pi"] + "\\pi", "\\infty"] if(wrapIn$) for(let i = 0; i < unicodechars.length; i++) { if(vari.includes(unicodechars[i]))