How to find the radius of the circle after adding the area of segment?

72 Views Asked by At

I am making a game where a circle can hit a wall an interact with it to simulate a ball hitting a wall.

When the circle is 1/4 the radius through the wall the area of the part in the wall will be added to the area of the part outside the wall, thus increasing the radius of the circle to adopt for the area been added.

The area of the part outside of the wall (big circle) has to be the same as the area of the small circle.

In the image the wall is represented by the vertical line. The distance from the wall and the centre of the circle does not change because the circle does not move it just changes shape.

Given the radius (r) and the distance (h) from the wall. What will be the radius (R) of the new bigger circle?

Graph example

Image example

1

There are 1 best solutions below

0
On BEST ANSWER

I don't think an analytical solution exists for $R$. But you can use the equation for the area of an annulus sector to get a good approximation.

The area of the segment of the small circle is given by:

$$A_1 = r^2 \cos^{-1}(\frac{h}{r})-h\sqrt{r^2-h^2}$$

where the angle of the segment is given by:

$$\theta = 2 \cos^{-1}(\frac{h}{r})$$

In the diagram below we see an annulus sector which approximates the area we are looking for.

enter image description here

The area of the annulus sector is given by:

$$A_2 = \frac{2\pi - \theta}{2}(R^2-r^2)$$

Setting $A_1 = A_2$ and rearranging the three formulas, we have the following approximation for the radius of the large circle:

$$R \approx \sqrt{\frac{A_1}{\pi - \cos^{-1}(\frac{h}{r})}+r^2}$$