Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/334.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 计算数字_Python_Figures - Fatal编程技术网

Python 计算数字

Python 计算数字,python,figures,Python,Figures,在Python中,有没有办法将图形作为一组点进行计算 我的意思是,假设我定义了一个圆周和一个三角形,然后,我定义了一个新的图形,它是三角形和圆周相交的结果。对于生成的图形/曲面,我还想添加或相交更多的图形,并从中获得一些属性,如生成图形的质心。是否有任何库我可以这样做?我认为用matplotlib是不可能的 例如: c = circumference(0,0,1) #circumference at 0,0 and radius 1 t = triangle([0,0], [-2,2], [1,

在Python中,有没有办法将图形作为一组点进行计算

我的意思是,假设我定义了一个圆周和一个三角形,然后,我定义了一个新的图形,它是三角形和圆周相交的结果。对于生成的图形/曲面,我还想添加或相交更多的图形,并从中获得一些属性,如生成图形的质心。是否有任何库我可以这样做?我认为用matplotlib是不可能的

例如:

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
谢谢。

我找到了这个。从网站上我们可以看到:

Symphy的几何模块允许创建二维几何图元,如直线和圆,并查询有关这些图元的信息

看一看。