kostub / iosMath

Beautiful math equation rendering on iOS and MacOS
MIT License
1.37k stars 234 forks source link

not an issue - fyi - latext + swift + sympy + python + tensorflow #106

Closed johndpope closed 6 years ago

johndpope commented 6 years ago
screen shot 2018-09-15 at 11 53 43 am screen shot 2018-09-15 at 11 36 49 am

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.

 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

Happypig375 commented 6 years ago

So what is the information that you are trying to FYI?