Skip to content
Related Articles

Related Articles

Improve Article

Python | Sympy equation() method

  • Last Updated : 27 Sep, 2019
Geek Week

In Simpy, the function equation() is used to make equation of a given circle.
Syntax : equation(x='x', y='y')

Parameters:
x : str or Symbol, optional
y : str or Symbol, optional

Returns : SymPy expression

Example #1:




# import sympy, Point and Circle
from sympy import Point, Circle
  
# using Circle()
c1 = Circle(Point(0, 0), 5)
c2 = c1.equation()
  
print(c2)

Output:

x**2 + y**2 - 25

Example #2:






# import sympy, Point and Circle
from sympy import Point, Circle
  
# using Circle()
c3 = Circle(Point(1, 2), 5)
c4 = c3.equation()
  
print(c4)

Output:

(x - 1)**2 + (y - 2)**2 - 25

 Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.  

To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course

My Personal Notes arrow_drop_up
Recommended Articles
Page :