Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I'm looking for an average value of sine of an angle between two rays, lying within a cone with a certain angle.

Given a cone with an aperture of ${2\chi}$ and two rays lying within the cone. The rays can be represented as vectors in a spherical coordinate system:

$$ {\vec{e_1}=\lbrace1,\phi_1,\theta_1 \rbrace},{\vec{e_2}=\lbrace1,\phi_2,\theta_2 \rbrace} $$

where ${\phi_1,\phi_2\in[0,2\pi], \theta_1,\theta_2\in[0,\chi]}$ (assuming the axis of the cone is aligned with the z axis). The distribution of every angle is uniform. It is needed to find the average value of the sine of the angle between the rays (vectors).

We can get an answer by simply integrating the sine within a needed area: $$ {{\frac{1}{4\pi^2\chi^2}}\int\limits_{0}^{\chi}\int\limits_{0}^{\chi}\int\limits_{0}^{2\pi}\int\limits_{0}^{2\pi}\sin(\vec{e_1},\vec{e_2})d\phi_1\phi_2\theta_1d\theta_2} $$

We can get cosine of an angle between the vectors using the dot product:

$${\cos(\vec{e_1},\vec{e_2})=\frac{(\vec{e_1},\vec{e_2})}{|\vec{e_1}||\vec{e_2}|}}=\sin\theta_{1}\sin\theta_{2}\cos\left(\phi_{1}-\phi_{2}\right)+\cos\theta_{1}\cos\theta_{2}$$

Using this an average value of cosine can be easily got:

$$ {{\frac{1}{4\pi^2\chi^2}}\int\limits_{0}^{\chi}\int\limits_{0}^{\chi}\int\limits_{0}^{2\pi}\int\limits_{0}^{2\pi}\cos(\vec{e_1},\vec{e_2})d\phi_1\phi_2\theta_1d\theta_2=\frac{\sin^2\chi}{\chi^2}} $$

But I didn't have much luck trying to get the average value of sine. I can't solve this:

$$ {{\frac{1}{4\pi^2\chi^2}}\int\limits_{0}^{\chi}\int\limits_{0}^{\chi}\int\limits_{0}^{2\pi}\int\limits_{0}^{2\pi}\sqrt{1-\left(\sin\theta_{1}\sin\theta_{2}\cos\left(\phi_{1}-\phi_{2}\right)+\cos\theta_{1}\cos\theta_{2}\right)^{2}}d\phi_1\phi_2\theta_1d\theta_2} $$

Using the Monte-Carlo simulation I got this curve:

Monte Carlo simulations of an average sine of an angle between two rays in a cone

Any help would be appreciated!

share|improve this question
    
Why is there a limit on both $\theta$ and $\phi$? Assuming the axis of the cone is aligned with the zenith direction, the polar angle should range from $0$ to $\chi$ while the azimuthal angle should span its whole range of $2\pi$. (I'm using terminology from Wikipedia's page on spherical coordinates because conventions differ on which angle is $\theta$ and which is $\phi$.) –  Rahul May 11 '12 at 9:03
    
Oops, it seems as if you are right and my limits for angles should be reviewed. Thank you. –  Installero May 11 '12 at 9:14
    
Are the ray vectors uniform random variates in the interior of the spherical cone, or on the surface of it? These give rise to two different measures, $$ dV=r^2\sin\phi\,dr\,d\phi\,d\theta=dr\,dS \qquad\text{and}\qquad dS=r^2\sin\phi\,d\phi\,d\theta=r^2\,d\Omega $$ The former is $dr$ times the latter which, in turn, is $r^2$ times the solid angle element $d\Omega$. Which of these you are using not only will affect the numerical answer but possibly also its closed form integrability. This might also help you solve it. –  bgins May 11 '12 at 13:32
    
If you use $\theta\in[0,2\pi)$ for the longitudinal rotation between the two points (which is uniformly distributed) and $\phi_1,\phi_2\in[0,\pi]$ for complement of the latitude of each point, i.e. the angle from the north pole, then a point would have cartesian coordinates $(x,y,z)=(\sin\phi\cos\theta,\sin\phi\sin\theta,\cos\phi)$ and the angle $\alpha$ between our points has cosine $\cos\alpha=\cos\phi_1\cos\phi_2+\sin\phi_1\sin\phi_2\cos\theta$. This symmetry eliminates one longitudinal $\theta$ from the integral. I think you are missing $\sin\phi_1\sin\phi_2$ in your area elements. –  bgins May 11 '12 at 13:57
    
Where did this problem arise? –  bgins May 12 '12 at 6:11

1 Answer 1

This is how I might set up this problem: just a hint at one possible start. (Not an answer!)

If we parametrize the unit sphere $S^2$ by $\mathbf{x}=(\theta,\phi)\in[0,2\pi)\times[0,\pi]$, then the area element is $dS=\sin\phi\,d\theta\,d\phi$, and we are interested in the polar region $R=[0,2\pi)\times[0,\chi]$ which has area $$ A=\int_{R}\,dS=\int_{0}^{\chi}\int_{0}^{2\pi}\sin\phi\,d\theta\,d\phi =2\pi\int_{0}^{\chi}\sin\phi\,d\phi =2\pi\left(1-\cos\chi\right). $$ The average value of the sine of the angle $\alpha=\alpha_{\mathbf{xy}}$ between uniformly random points $\mathbf{x},\mathbf{y}\in R$ is then $$ \eqalign{ \overline{\sin\alpha}& =\frac1{A^2}\iint_{R^2}\sin\alpha\,dS_{\mathbf{x}}\,dS_{\mathbf{y}} =\frac1{A^2}\iint_{[0,2\pi)\times[0,\chi]^2} \sin\alpha \sin\phi_\mathbf{x}\sin\phi_\mathbf{y} \, d\phi_\mathbf{x}\, d\phi_\mathbf{y} \, d\theta } $$ where now, like you, using subscripts $1$ and $2$ in place of $x$ and $y$, $$ \eqalign{ \cos\alpha &=\cos\phi_1\cos\phi_2+\sin\phi_1\sin\phi_2\cos\theta\\ &=\frac{\cos(\phi_1-\phi_2)+\cos(\phi_1+\phi_2)}2 +\frac{\cos(\phi_1-\phi_2)-\cos(\phi_1+\phi_2)}2\cos\theta\\ &=\cos(\phi_1+\phi_2)\frac{1-\cos\theta}2 +\cos(\phi_1-\phi_2)\frac{1+\cos\theta}2\\ &=\cos(\phi_1+\phi_2)\,\sin^2\frac\theta2 +\cos(\phi_1-\phi_2)\,\cos^2\frac\theta2\\ } $$ since $\theta=\theta_\mathbf{x}-\theta_\mathbf{y}$ is uniformly distributed in $[0,2\pi)$ (up to a trivial additive multiple of $2\pi$).

share|improve this answer
    
If I'm not mistaken, the last line should be like this: $$ {=\cos(\phi_1+\phi_2)\,\sin^2\frac{\theta}{2} +\cos(\phi_1-\phi_2)\,\cos^2\frac{\theta}{2}} $$ Thank you for your help! Will see if I can integrate that. –  Installero May 12 '12 at 4:48
    
Yes, thanks...got lost in transcription. –  bgins May 12 '12 at 6:08
    
Asked another question at last: math.stackexchange.com/questions/147662/… –  Installero May 22 '12 at 6:53
    
Btw, It should be $A^2$ in the equation for the average sine... –  Installero May 22 '12 at 6:54
    
Thanks again... –  bgins May 22 '12 at 14:28

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.