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:


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!

  • $\begingroup$ 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$.) $\endgroup$
    – user856
    May 11 '12 at 9:03
  • $\begingroup$ Oops, it seems as if you are right and my limits for angles should be reviewed. Thank you. $\endgroup$
    – installero
    May 11 '12 at 9:14
  • $\begingroup$ 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. $\endgroup$
    – bgins
    May 11 '12 at 13:32
  • $\begingroup$ 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. $\endgroup$
    – bgins
    May 11 '12 at 13:57
  • $\begingroup$ Where did this problem arise? $\endgroup$
    – bgins
    May 12 '12 at 6:11

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$).

  • $\begingroup$ 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. $\endgroup$
    – installero
    May 12 '12 at 4:48
  • $\begingroup$ Yes, thanks...got lost in transcription. $\endgroup$
    – bgins
    May 12 '12 at 6:08
  • $\begingroup$ Asked another question at last: math.stackexchange.com/questions/147662/… $\endgroup$
    – installero
    May 22 '12 at 6:53
  • $\begingroup$ Btw, It should be $A^2$ in the equation for the average sine... $\endgroup$
    – installero
    May 22 '12 at 6:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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