Sympy python circumference
- by Mattia Villani
I need to display a circumference. In order to do that I thought I could calculata for a lot of x the two values of y, so I did:
import sympy as sy
from sympy.abc import x,y
f = x**2 + y**2 - 1
a = x - 0.5
sy.solve([f,a],[x,y])
and this is what I get:
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/usr/lib/python2.7/dist-packages/sympy/solvers/solvers.py", line 484, in
solve
solution = _solve(f, *symbols, **flags)
File "/usr/lib/python2.7/dist-packages/sympy/solvers/solvers.py", line 749, in
_solve
result = solve_poly_system(polys)
File "/usr/lib/python2.7/dist-packages/sympy/solvers/polysys.py", line 40, in
solve_poly_system
return solve_biquadratic(f, g, opt)
File "/usr/lib/python2.7/dist-packages/sympy/solvers/polysys.py", line 48, in
solve_biquadratic
G = groebner([f, g])
File "/usr/lib/python2.7/dist-packages/sympy/polys/polytools.py", line 5308, i
n groebner
raise DomainError("can't compute a Groebner basis over %s" % domain)
DomainError: can't compute a Groebner basis over RR
How can I calculate the y's values ?