I'm trying to determine 'how much' (as a percentage) a 2D rectangle fills a 2D circle.
Actual Application:
I was comparing the accuracy of some computer game weapons by calculating the max possible dispersion from the weapon's shell origion at a given range. After that, I added a player stand in to help visualize the possible dispersion vs size of the target. Of course I can eyeball the values, but I don't know how to calculate this geometry (as the player's head and feet would not actually be inside the dispersion area, so a basic area calculation is not accurate).
Any guidance is appreciated.
UPDATE:
I'm sorry that the question was not more clear, I'll try to elaborate:
In the case of the smaller circle, if you did a basic area calculation of the circle (1.828) and the rectangle (1.6), the result would say that the rectangle fills ~87% of the circle. However, the person cannot be compacted, and their upper body and lower body do not fall within the circle, and therefore the result is not accurate.
Now I think all I need to do is to subtract the difference of the circle's diameter from the max extents of the rectangle (so 2m - 1.526 = 0.474, or in other words, just make the rectangle as tall as the circle's diameter) making the rectangle's new area 1.526 * 0.8. Making the new percentage ~69%, which should be much more accurate. Am I on the right track?
Image:

Actual Values from the Test:
Player: 2m tall, 0.8m wide.
Weapon Dispersion Circle A (green): radius = 0.763.
Weapon Dispersion Circle B (red): radius = 1.05.
This is not an answer but a long comment to present some code to compute the numbers.
For a more human readable description about the math behind the screen, please consult this answer instead. It is pointless to repeat the description here.
The numerical values of the two areas are
Computing using an user-defined function
ar_area(r,xc,yc,x0,y0,x1,y1). Theris the radius of the circle,(xc,yc)its center. The(x0,y0)and(x1,y1)specify the lower-left and upper-right corner of the rectangles.Following are the actual code in
maximaI used to compute these numbers. I think it should be obvious how to translate it to other languages.