there's only a couple lines of code above but I believe it's quite a breakthrough for maths + swift.
let latex = Python.import("sympy.parsing.latex")
let expr = latex.parse_latex("x = \\frac{-b \\pm \\sqrt{b^2-4ac}}{2a}")
print("expr:",expr) // here you can see that sympy which is running in swift and tapping into antlr (pip install antlr4-python2-runtime) has correctly interpolated and symbolicated the formula as an expression. This can open a lot of doors for machine learning science and learning maths.
I've uploaded project here ->
https://github.com/johndpope/SwiftReinforce
note - this is using sympy and needs python antlr runtime ( pip install antlr4-python2-runtime) - so it's actually possible to pass in values. this is not just for rendering.
https://www.youtube.com/watch?v=AqnpuGbM6-Q
Eq(x, (-bpmsqrt(-4ac + b*2))/((2a)))
there's only a couple lines of code above but I believe it's quite a breakthrough for maths + swift.
print("expr:",expr) // here you can see that sympy which is running in swift and tapping into antlr (pip install antlr4-python2-runtime) has correctly interpolated and symbolicated the formula as an expression. This can open a lot of doors for machine learning science and learning maths. I've uploaded project here -> https://github.com/johndpope/SwiftReinforce
note - this is using sympy and needs python antlr runtime ( pip install antlr4-python2-runtime) - so it's actually possible to pass in values. this is not just for rendering. https://www.youtube.com/watch?v=AqnpuGbM6-Q