简体   繁体   English

圆与矩形的相交面积

[英]Area of intersection of a circle with a rectangle

I want to find the area of a given circle that comes under the region of a given rectangle. 我想找到位于给定矩形区域下方的给定圆的区域。 I searched many posts on stackoverflow but they are not satisfying. 我搜索了许多关于stackoverflow的帖子,但它们并不令人满意。 I followed this post 我关注了这篇文章
http://www.eex-dev.net/index.php?id=100 http://www.eex-dev.net/index.php?id=100
But it doesn't seem accurate. 但这似乎并不准确。 I'd appreciate if someone provides me a good accurate solution atleast upto 10^-6 precision. 如果有人能为我提供至少10 ^ -6精度的良好精确解决方案,我将不胜感激。 Thanks. 谢谢。

Linked article uses integration method of left rectangle rule that suffers from precision loss (here value is underestimated because envelope is convex or straight). 链接的文章使用遭受精度损失的左矩形规则的积分方法(由于信封是凸的或直的,因此此处的值低估了)。

You can use more precise approaches such as Simpson's rule or Gaussian quadrature . 您可以使用更精确的方法,例如Simpson规则或高斯求积

Moreover, every configuration might be subdivided into simple parts - rectangle, triangle, circle segment with known exact area formula! 此外,每个配置都可以细分为简单的部分-具有已知精确面积公式的矩形,三角形,圆形部分!

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

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