Area of intersection between circle and rectangle

后端 未结 7 842
陌清茗
陌清茗 2020-12-13 19:35

I\'m looking for a fast way to determine the area of intersection between a rectangle and a circle (I need to do millions of these calculations).

A specific property

7条回答
  •  青春惊慌失措
    2020-12-13 20:23

    Thanks for the answers,

    I forgot to mention that area estimatations were enough. That; s why in the end, after looking at all the options, I went with monte-carlo estimation where I generate random points in the circle and test if they're in the box.

    In my case this is likely more performant. (I have a grid placed over the circle and I have to measure the ratio of the circle belonging to each of the grid-cells. )

    Thanks

提交回复
热议问题