简体   繁体   English

两个椭圆(椭圆)交叉的区域?

[英]The area of the intersection of two ovals (ellipses)?

I need to calculate the amount of two oval intersects in a python program. 我需要计算python程序中两个椭圆相交的数量。 I know in shaply there is a function that return true if two object has intersects. 我知道,如果两个对象相交, 有一个函数返回true。 As like as this: 就像这样:

from shapely.geometry import Polygon
p1=Polygon([(0,0),(1,1),(1,0)])
p2=Polygon([(0,1),(1,0),(1,1)])
print p1.intersects(p2)

is there any library or function That help me? 是否有任何图书馆或功能帮助我? Thanks. 谢谢。

Is this what you are looking for? 这是你想要的? (the polygon that results from the intersection) (交叉点产生的多边形)

x = p1.intersection(p2)
x.area

Find more information in the documentation here 此处的文档中查找更多信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM