Polygon
RegularPolygon() method from the geometry class is used to construct a RegularPolygon. It takes the below parameters :
class sympy.geometry.polygon.RegularPolygon()
Python3
# importing packages from sympy import RegularPolygon, Point fig = RegularPolygon(Point( 0 , 0 ), 1 , 3 ) # area of the regular polygon print (fig.area) |
Output:
3*sqrt(3)/4
What are Entities in SymPy?
The geometry module in SymPy is the foundation class for all geometrical entities Python, allowing you to create two-dimensional objects like lines and circles, polygons, etc. Then we may find out more about it by looking for collinearity or detecting intersections. Any object with particular geometric qualities is referred to as a GeometryEntity.
class sympy.geometry.entity.GeometryEntity(*args, **kwargs)
All geometrical entities inherit from this basic class. This class does not represent any specific geometric entity; instead, it implements several methods that are shared by all subclasses.