[Math] Formula for area of circle sector inside rectangle

circlesgeometryrectangles

Pretend that I have an $W$x$H$ rectangle, inside of which there is a given point. Let's set up coordinates: (0,0) is at the bottom left of the rectangle, and the point is at (x,y), with 0<=x<=W and 0<=y<=H. From this point, I draw a sector of a circle which can be pointing in any direction $\phi$, and has angular width $\theta$ and radius $R$. The sector might have some (or all) of its area outside the rectangle, depending on the configuration and the parameters.

I want an expression, $A(W,H,\theta,\phi,R,x,y)$ for the area of the sector that is inside the rectangle. It will be a piece-wise expression with multiple pieces corresponding to different geometric situations, e.g. the chord of the sector is completely outside the rectangle so the only overlapping area is a part of a triangle, etc.

Best Answer

Depending on the value of $\theta$ and $\phi$, the locations of Y, U, M, V, Y may vary. We only discuss the simplest case. (I think the same logic is applicable to other cases.)

enter image description here

When $\theta$ and $\phi$ are known, U and V are found (and assumed) to be located on the top edge of the rectangle.

0) Find the co-ordinates of X, U, M, V, Y.

1) Find $[\triangle PUM]$.

2) Find all the sides of $\triangle PMV$.

3) Find $\alpha$ by cosine law.

4) Find [sector PMY].

Related Question