
let sympy = Python.import("sympy")
let latex = Python.import("sympy.parsing.latex")
let expr = latex.parse_latex("x = \\frac{-b \\pm \\sqrt{b^2-4ac}}{2a}")
print("expr:",expr)
po expr

--
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscribe@googlegroups.com.
To post to this group, send email to sy...@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/82ec7a16-49ec-4e66-ae68-c9c57318f5a1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
| let a = sympy.DeferredVector("a") | |
| let s = sympy.DeferredVector("x") | |
| let t = sympy.Symbol("t") | |
| let dist2 = sympy.Pow(a[0]+s[0]*t,2) + sympy.Pow(a[1]+s[1]*t,2) + sympy.Pow(a[2]+s[2]*t,2) | |
| let ddist2_dt = sympy.diff(dist2,t) | |
| let funcArray = sympy.solvers.solve(ddist2_dt, t) | |
| print("func:",funcArray) | |
| let strTest = lambdify.lambdastr([a,s],funcArray[0]) | |
| print("λ str:",strTest)//lambdastr: lambda a,x: (-(a[0]*x[0] + a[1]*x[1] + a[2]*x[2])/(x[0]**2 + x[1]**2 + x[2]**2)) | |
| let λ = Python.eval(strTest,["builtins":"None"]) | |
| print("λ fn:",λ) | |
| // let xArray = np.array(1) | |
| // let aArray = np.array(1,1) | |
| // | |
| // let e0 = Python.map(λ,xArray,aArray) | |
| // print("λ(1,2):",λ(xv,av) |
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+un...@googlegroups.com.
To post to this group, send email to sy...@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/82ec7a16-49ec-4e66-ae68-c9c57318f5a1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+un...@googlegroups.com.
To post to this group, send email to sy...@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CAKgW%3D6JZZPSbOsJAWb2VNkNYE%2BtavRcGOhHZWF5D0AogiSU_oA%40mail.gmail.com.