8
$\begingroup$

I have found an answer on this site to the question of determining the mean straight-line distance between 2 randomly chosen points in a disc of radius r. (See Average distance between two points in a circular disk.) I'm now trying to find an answer to the same question except involving a sphere of radius r rather than a disc. Any guidance on this question would be appreciated.

  • 0
    Have you seen [this](http://mathworld.wolfram.com/SphereLinePicking.html)?2012-07-07

3 Answers 3

13

(a) Two random points on the unit sphere $S^2$:

Assume the first point at the north pole ($\theta=0$) of $S^2$. Then the distance to a point at latitude $\theta$ is $2\sin{\theta\over2}$. Therefore the mean distance between the north pole and the second point is given by ${1\over 4\pi}\int_0^\pi 2\sin{\theta\over2}\cdot 2\pi\sin\theta\ d\theta={4\over3}\ .$ $ $

(b) Two random points in the unit ball of ${\mathbb R}^3\ $:

Let ${\bf X}$ and ${\bf Y}$ be the two random points. Then $R:=|{\bf X}|$, $\ S:=|{\bf Y}|$, and $\Theta:=\angle({\bf X},{\bf Y})$ are independent random variables with densities $f_R(r)=3r^2\quad (0\leq r\leq 1)\ ,\qquad f_S(s)=3s^2\quad(0\leq s\leq 1)\ ,$ and $f_\Theta(\theta)={1\over2}\sin\theta\quad(0\leq\theta\leq\pi)\ .$ (Concerning $f_R$ and $f_S$ note that the volume included between $r$ and $r+dr$ is proportional to $r^2$. For $f_\Theta$ you may assume ${\bf X}$ pointing due north. The abstract surface area between $\theta$ and $\theta+d\theta$ is then proportional to $\sin\theta$, as in (a).)

It follows that the mean distance $\delta$ between ${\bf X}$ and ${\bf Y}$ is given by $\delta=\int_0^1\int_0^1\int_0^\pi \sqrt{r^2+s^2-2rs\cos\theta}\ f_R(r) f_S(s)f_\Theta(\theta) d\theta\ ds\ dr\ .$ The innermost integral computes to $\eqalign{{1\over2}\int_0^\pi \sqrt{r^2+s^2-2rs\cos\theta}\ \sin\theta\ d\theta&={1\over 6rs}\bigl(r^2+s^2-2r s\cos\theta\bigr)^{3/2}\Biggr|_0^\pi \cr &={1\over 6rs}\bigl((r+s)^3-|r-s|^3\bigr)\ . \cr}$ In the sequel we assume $s\leq r$ and compensate this by a factor of $2$. We are then left with $\delta=\int_0^1\int_0^r 3r s(6r^2 s +2s^3)\ ds\ dr={36\over35}\ .$ It should not be too difficult to set a similar computation up that is valid for a ball in any ${\mathbb R}^n$, $\ n\geq 2$.

  • 0
    Perfect! Thank you so much.2012-07-08
5

The average distance can be calculated as a triple integral in polar coordinates:

enter image description here

We ran into it some years back when doing research on proteins (http://www.ncbi.nlm.nih.gov/pubmed/9514112).

0

This isn't a complete answer, but a start, a rough one at that.

Given two points $p_0$ and $p_1$ find a third point $p_2$ such that $N=(p_0-p_2)\times(p_1-p_2) \neq \varnothing$ Where $\varnothing$ is the null vector. Define $n = \frac{N}{|N|}$ that is normalize the vector $N$, without normalization the distance won't be correct below.

Now we have a plane where $p$ is any point on it defined as: $ n\cdot(p-p_2)=0 \\ n\cdot p-n\cdot p_2=0 \\ n\cdot p = n\cdot p_2\\ $ Recall the general equation of a plane is $ax+by+cz=d$ where $d$ is the distance from the origin to the plane. Expanding out the above equation gives us $a=n_x,b=n_y,c=n_z \\ d=n_xp_{2x}+n_yp_{2y}+n_zp_{2z} $ Radius of the resulting circle in the plane with a sphere of radius $r$ is given as $R = \sqrt{r^2-d^2} $ You may want to negate $n$ if $d$ is negative as that will allow you to have the center of the circle at $(da,db,dc)$

We haven't defined an axes for our plane so its difficult to map from our 3D points onto it. This is where I'm stopping for now. (I might come back and finish this up) I have a feeling this approach is more of a hassle than just computing $p_0-p_1$ and calculating its length. Namely because we have to normalize a vector ($N$) just to get a distance and thus the radius.

Wiki pages I used for this: Plane and Plane-sphere intersection

  • 0
    Yeah when I set out to write this answer I thought you just needed to use the same method for a disc but in the ball. I should have noticed the probability distributions tag and that you are going to have a large number of points2012-07-07