1

Is there any way to compute figures as a sets of points in Python?

I mean, lets say that I define a circumference and a triangle and then, I define a new figure that is the result of the intersection of the triangle and the circumference. With that resulting figure/surface, I also want to add, or intersect more figures and get some properties from it, like the centroid of the resulting figure. Is there any library which I can do it? I think it's not possible with matplotlib...

For example:

c = circumference(0,0,1) #circumference at 0,0 and radius 1
t = triangle([0,0], [-2,2], [1,1])
new_figure = c & t
print (new_figure.centroid())
>>-0.5, 0.77

Thank you.

cuentafalsa7
  • 23
  • 1
  • 6

1 Answers1

1

I have found this library. From the website we can see that:

The geometry module for SymPy allows one to create two-dimensional geometrical entities, such as lines and circles, and query for information about these entities.

Motine
  • 1,638
  • 18
  • 18