# What is the distance between a point outside of circle and any point inside the circle?

Point $P$ is located at distance $d$ from a circle with radius $r$ (that is $d+r$ from the center of circle). What would be the expected value of the distance between the point $P$ and any random (uniform) point in the circle and why?

• Hint: Distance is the same along circles of center $P$ and radius between $d$ and $d+2r$. – Smurf Feb 19 '17 at 15:39
• @Smurf Correct, but what is the pdf and how to calculate the expected value? – fhm Feb 19 '17 at 15:44
• Roughly speaking, the pdf should be like this: $$f(t)=t\cdot l(t)$$ where $$l:t\mapsto \text{measure of the set of points at length t from P}$$ So the problem would be to explicitly calculate the function $l$, here you can use my previous hint. – Smurf Feb 19 '17 at 15:54
• Did you manage to solve it? – Smurf Feb 20 '17 at 18:10
• @Smurf I've been trying to figure out $l(t)$ and integral, yet was unsuccessful. – fhm Feb 21 '17 at 6:45

According to this post

https://en.wikipedia.org/wiki/Circular_segment

we need to calculate $d+x$ (notice that our $d$ is not equal to the one in the post) in order to get $\theta$ and finally $s$.

Let's start by calculating $x$, in the picture there are two right triangles that share a side, let's call it $y$, then

$$\left\{\begin{matrix}R^2&=&(d+x)^2+y^2\\r^2&=&(r-x)^2+y^2\end{matrix}\right.\Rightarrow R^2-(d+x)^2=r^2-(r-x)^2\Rightarrow x=\frac{R^2-d^2}{2(d+r)}$$

thus $$\theta=2\arccos\bigl(\frac{d+x}{R}\bigl)=2\arccos\bigl(\frac{R^2-d^2}{2R(d+r)}+\frac{d}{R}\bigl)$$ and finally $$l(R)=2R\arccos\bigl(\frac{R^2-d^2}{2R(d+r)}+\frac{d}{R}\bigl)$$

• I appreciate your effort. You actually conclude with $l(R)=R\theta$ where $R\in[d,d+2r]$ is chosen randomly ($R$ instead of $t$?). May Integration by parts solve the integrate over $l(R)$. – fhm Feb 21 '17 at 16:17
• Yes, that should do it. Although nothing pretty seems to come out of that. – Smurf Feb 21 '17 at 17:20
• Another way might be using coordinates (cartesian or polar) and do a double integral. At first I thought this way would be more messy, until I saw the integral we got here. – Smurf Feb 21 '17 at 17:23
• In Matlab: let's set d=30, r=10. Define f as f=@(x)2.*x.*acos(((x.^2-d^2)./(2.*x.*(r+d)))+d./x).*(1/((d+2‌​*r)-d)); (Uniform pdf at the end). Now the integration integral(f,d,d+(2*r)) returns the same value as if d=60, r=10 or d=200, r=10. The solution only depends on r. Why? – fhm Feb 26 '17 at 7:59