from sympy import symbols, Eq, solve, Circle, Point, latex, simplify, sympify
x, y = symbols('x y')
m = Circle(Point(0, 0), Point(1, 0), Point(0, 2))
dt = m.equation()
dt = dt.subs(x,2)
print(dt)
The answer should be like be
k=(x - 1/2)**2 + (y - 1)**2 - 5/4
k = k.subs(x, 2)
print(k)
I tried to copy the whole block inside sympy lib but it got confused of the "_symbol". The type of dt is <class 'sympy.core.add.Add'> but when open lib, I couldn't find sympy.core.add.Add.
I hope to change to value of x and y inside the equation so it would give the answer like the second line.
The issue is that the
xanyfrom a naiveCircle.equation()are not the sameSymbols as you created (despite appearances), and you should either pass in the symbols as arguments or use the defaults and get them from the equation (How can I get a list of the symbols in a sympy expression? )Passing in the symbols
extracting them from it into a dict (ugly)
Finally, you could use lambdify it