Average distance from a square’s perimeter to its center

calculusgeometry

What is the average distance from any point on a unit square's perimeter to its center?

The distance from a square's corner to its center is $\dfrac{\sqrt{2}}{2}$ and from a point in the middle of a square's side length is $\dfrac{1}{2}$. A visual explanation of what I'm trying to explain

So, what would the average distance be, accounting for all the points along a square's perimeter?

Also if possible, a general formula for finding the average distance from center to edge of any $n$-sided regular polygon would be super awesome.

Best Answer

enter image description here

Consider a square ABCD of side $a$ centered at the origin $O$ (as shown in above figure) By symmetry, the square ABCD is divided into $8$ congruent right triangles.

Consider any arbitrary point $P$ on square in first quadrant at an angle $x$ with +ve X-axis. The distance of point P from the center O is $\dfrac{a}{2}\sec x$. Taking average of distances of all the points on the perimeter of square (using symmetry of quadrants) as follows $$D_\text{avg}=\frac{8\int_0^{\pi/4}\frac{a}{2}\sec x\ dx}{2\pi}$$ $$=\frac{2a}{\pi}\int_0^{\pi/4}\sec x\ dx$$ $$=\frac{2a}{\pi}\left[\ln\left|\tan\left(\frac{x}{2}+\frac{\pi}{4}\right)\right|\right]_0^{\pi/4}$$ $$=\frac{2a}{\pi}\ln(\sqrt2+1)$$ Therefore, the average distance from the center of all the points on the perimeter of a unit square ($a=1$) will be $$\frac{2}{\pi}\ln(\sqrt2+1)\approx 0.561099852 \ \mathrm{unit}$$