Finding the sine of the angle between 2 rays

In summary, the conversation discusses the problem of finding the sine of the angle between two intersecting rays on a unit sphere. The dot product of the two vectors is used to find the cosine of the angle, but the computation for the sine of the angle is more complex and involves taking a cross product. The final expression involves multiple terms and has not been simplified further. The individual discussing the problem has attempted to simplify the expression using trigonometric identities, but has been unsuccessful so far. They also mention the possibility of simplification through integration, but have not explored this option yet.
  • #1
Matterwave
Science Advisor
Gold Member
3,971
328
Hello, say you are on the unit sphere and you have 2 rays intersecting it from the origin. You know the spherical coordinates of where these 2 rays intersect the sphere ##(\theta_1,\phi_1),(\theta_2,\phi_2)##.

Now, because we know the dot product of two vectors, it is simple to get that the cosine of the angle between these 2 rays. You convert the spherical coordinates to Cartesian coordinates (with ##r=1##) and take the dot product product to get : $$\cos\theta=\cos\theta_1\cos\theta_2+\sin\theta_1\sin\theta_2(\cos\phi_1\cos\phi_2+\sin\phi_1\sin\phi_2)$$

What I want now is the sine of the angle. Of course, it is easy to do ##\sin\theta=\sin(\cos^{-1}(\cos\theta))##. However, for computational reasons, it would be much more beneficial to me if I could get this sine in terms of sines and cosines of ##\theta_1,\phi_1,\theta_2,\phi_2##. I can take the cross product and do a similar thing to get this, but that formula is horrendous. Because it involves a magnitude, there's a square root of a bunch of squares of a ton of terms. Anyone know what the final result of this computation is? I'm guessing that the terms will simplify significantly, but I wrote them down and aside from a few simple simplifications, could not simplify further.
 
Mathematics news on Phys.org
  • #2
Compute the cosine and then use ##\cos^2 + \sin^2 = 1##. Of course, this is not a way around the square root, you will have to live with that.
 
  • #3
This seems...equally horrendous..=/

At the end of the computation, I will have to average over all azimuthal angles of ##\phi_2## assuming spherical symmetry, and so actually I can use ##\cos\theta=\cos\theta_1\cos\theta_2## because the integrals of ##\sin x,\cos x## over 2 pi is 0. I was hoping for a similar simplicity in the sine result..
 
  • #4
I feel like I've made a little progress. I looked at the formula for ##\sin(x-y)=\sin x\cos y-\cos x\sin y##. My formula should reduce to this formula if ##\phi_1=\phi_2=0##, since if we are in a plane, then the angle between our rays will simply be ##\theta_1-\theta_2##. So I looked at the monster that is the current, unsimpified form, of my formula and it looks like the monster formula could be some square of this. The last term in my formula is: $$-2\sin\theta_1\cos\theta_1\sin\theta_2\cos\theta_2(\sin\phi_1\sin\phi_2+\cos\phi_1\cos\phi_2+ \cos\phi_1\cos\phi_2\sin\phi_1\sin\phi_2)$$

It looks like if you took the square of $$\sin\theta_1\cos\theta_2(1+f_1(\phi_1,\phi_2))-\cos\theta_1\sin\theta_2(1+f_2(\phi_1,\phi_2))$$ you could get a term that matches the last term. I need to figure out what ##f_{1,2}(\phi_1,\phi_2)## are, but so far no luck.
 
  • #5
I put my whole gigantic formula into wolfram..and it didn't come up with any simplifications...so maybe this can't be done :(
 
  • #6
I had a play with the expression. It comes down to writing that expression [itex]f(\theta_i , \phi_i )[/itex] in the form:
[tex] 1-f^2 = g^2[/tex] [tex] \iff f^2=1-g^2[/tex]
For some 'nice' function [itex]g(\theta_i , \phi_i )[/itex]. I don't think it's possible here either, and see no reason why it 'should' be.
 
  • #7
Jack Davies said:
I had a play with the expression. It comes down to writing that expression [itex]f(\theta_i , \phi_i )[/itex] in the form:
[tex] 1-f^2 = g^2[/tex] [tex] \iff f^2=1-g^2[/tex]

How is this different from what I already said in #2?
 
  • #8
Orodruin said:
How is this different from what I already said in #2?

Exactly the same. Apologies.
 
  • #9
Ok, maybe if I post the full problem, we can perhaps come up with something.

Assume there is a sphere from which rays of stuff (in my case, neutrinos, but that's not important for this part of the problem) emanate. These rays are emitted from this sphere and they intersect. At some distance away from the sphere, we look at two rays which intersect. They both will intersect a radial ray at some polar angle and some azimuthal angle ##(\theta_1,\phi_1)## and ##(\theta_2,\phi_2)## while they make some angle ##\theta## with each other. What I want is ##\sin\theta## as some expression of ##(\theta_1,\phi_1)## and ##(\theta_2,\phi_2)##.

There is an additional simplification here. We never track the azimuthal angles in our simulations (the simulations assume azimuthal symmetry), and so two rays which differ by ##\theta## are tracked and assumed different, but two rays which differ only by ##\phi## are not. So, we want to average over all the azimuthal angles at the end of the day.

Up to this point in the simulation I've been working on, we have only required use of ##\cos\theta##. This was easy to find because we can exploit the dot product of 2 vectors to find $$\cos\theta=\cos\theta_1\cos\theta_2+\sin\theta_1\sin\theta_2(\cos\phi_1\cos\phi_2+\sin\phi_1\sin\phi_2)$$. We average over all the ##\phi## angles, and since $$\frac{1}{2\pi}\int_0^{2\pi}\sin\phi d\phi=0$$ $$\frac{1}{2\pi}\int_0^{2\pi}\cos\phi d\phi=0$$ the second half the expression disappears and we use ##\cos\theta=\cos\theta_1\cos\theta_2##.

I want to now do this same procedure on ##\sin\theta##, but as said before, the expression is horrendous.

Taking the cross product of 2 unit vectors, we know that $$\sin\theta=||\hat{k_1}\times\hat{k_2}||=\left|\left|\begin{pmatrix} \sin\theta_1\sin\phi_1\cos\theta_2-\sin\theta_2\sin\phi_2\cos\theta_1 \\ \sin\theta_2\cos\phi_2\cos\theta_1-\sin\theta_1\cos\phi_1\cos\theta_2 \\ \sin\theta_1\cos\phi_1\sin\theta_2\sin\phi_2-\sin\theta_1\sin\phi_1\sin\theta_2\cos\phi_2\end{pmatrix}\right|\right|$$ As you can probably tell, this will look horrible. So far I have gotten the expression down to: $$\sin^2\theta=\sin^2\theta_1\cos^2\theta_2+\sin^2\theta_2\cos^2\theta_1+\sin^2\theta_1\sin^2\theta_2(\cos^2\phi_1\sin^2\phi_2+\sin^2\phi_1\cos^2\phi_2)- \\ 2\sin\theta_1\cos\theta_2\sin\theta_2\cos\theta_1(\sin\phi_1\sin\phi_2+\cos\phi_1\cos\phi_2+\cos\phi_1\cos\phi_2\sin\phi_1\sin\phi_2)$$

I have not been able to simplify this further. Somehow, though if I set ##\phi_1=\phi_2=0## I should get ##\sin\theta=\sin\theta_1\cos\theta_2-\sin\theta_2\cos\theta_1## because that's the sin addition formula. I seem to be able to retrieve this result so it looks like my work is ok...Can someone check the math a bit? Any ideas on how this simplifies? How about what would happen if I took the integral of this around both ##\phi##?

I looked at the expression and tried to reproduce this expression for ##\sin^2\theta## by looking at the product ##(\sin\theta_1\cos\theta_2(1+\sin\phi_1\cos\phi_2)-\cos\theta_1\sin\theta_2(1+\cos\phi_1\sin\phi_2))^2## and although I reproduce the first 2 terms and the last term in that long expression above, I can't reproduce the middle expression and there are too many terms in this. But it really seems like some sort of simplification like this should be possible...
 
Last edited:
  • #10
1. I'm no expert on math, but I think I can prove that the expression for ##\sin\theta## has to contain a ##\sqrt{\ }## somewhere:
The angle between the 2 rays can be seen as ##2\pi-\theta## as well as ##\theta##.
The cosine of these 2 angles is the same, so you can find a formula for ##\cos \theta##.
But the sine of those 2 angles has a different sign, which is a strong hint that a square root is involved.

2. I tried to do the calculation as well. I've arrived at something different, but I did all simplifications on paper, so probably made a mistake somewhere. Anyway, why don't you use the symmetry and replace ##\phi_2## with ##\phi_2-\phi_1##, and ##\phi_1## with ##0##?
The expression can then be simplified to the form
$$\sin(\theta)=\sqrt{a + b \sin(\phi_2-\phi_1) + c \cos(\phi_2-\phi_1) + d \sin^2(\phi_2-\phi_1)}$$
which, with some luck, can be integrated over ##\phi_2-\phi_1##.
 
  • #11
So your a,b,c,d, are expressions with ##\theta_1,\theta_2## in them I am assuming?
 
  • #12
Matterwave said:
So your a,b,c,d, are expressions with ##\theta_1,\theta_2## in them I am assuming?
Yes. I'm not entirely sure how the "integration" part of your problem works, but if I understand it correctly, it does not depend on the ##\theta##s.
 
  • #13
In fact, it's kind of obvious that the thing under square root will be ##1-\cos^2\theta##.
 
  • #14
Well yes, but i want it in terms of ##\theta_1,\theta_2## not ##\theta##
 
  • #15
Matterwave said:
$$\cos\theta=\cos\theta_1\cos\theta_2+\sin\theta_1\sin\theta_2(\cos\phi_1\cos\phi_2+\sin\phi_1\sin\phi_2)$$
$$\cos\theta=\cos\theta_1\cos\theta_2+\sin\theta_1\sin\theta_2\cos(\phi_2-\phi_1)$$
 
  • #16
SlowThinker said:
$$\cos\theta=\cos\theta_1\cos\theta_2+\sin\theta_1\sin\theta_2\cos(\phi_2-\phi_1)$$

Yes, the posters above you have suggested it, but it seems this expression is still quite cumbersome when you square it and then square root it with a 1- in front).
 
  • #17
Hmm.
Going back to base assumptions. You seem to be put off by calculating the arithmetic mean or some type of "average". Consider an online algorithm. This takes a steam of input, does not store very much in memory and is low overhead, and VERY simple to implement. Maybe you do not need a "gigantic formula". I cannot tell.

Here is a version from Knuth of an online algorithm. You can adapt it to most procedural programming languages that support I/O from files or the tty. There is some exposition at the top followed by simple pseudocode. This is for a variance. You alter it for your needs.

https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Online_algorithm
 

What is the sine of the angle between 2 rays?

The sine of the angle between 2 rays is a mathematical function that calculates the ratio of the length of the side opposite the angle to the length of the hypotenuse in a right triangle.

How is the sine of the angle between 2 rays calculated?

The sine of the angle can be calculated by dividing the length of the side opposite the angle by the length of the hypotenuse. This is expressed as sin(theta) = opposite/hypotenuse.

Why is finding the sine of the angle between 2 rays important?

Finding the sine of the angle between 2 rays is important in many fields, including mathematics, physics, engineering, and navigation. It is used to solve problems involving angles and distances, and can also be used to model periodic phenomena such as sound and light waves.

What is the relationship between the sine of the angle between 2 rays and the cosine of the same angle?

The sine and cosine of the same angle are closely related and can be calculated using the Pythagorean theorem. The cosine is equal to the adjacent side divided by the hypotenuse, while the sine is equal to the opposite side divided by the hypotenuse.

How do you find the sine of the angle between 2 rays on a calculator?

Most scientific calculators have a sine function, often represented as "sin" or "sin^-1". To find the sine of an angle between 2 rays on a calculator, enter the value of the opposite side, then divide it by the length of the hypotenuse. The resulting value is the sine of the angle.

Similar threads

Replies
1
Views
1K
  • Advanced Physics Homework Help
Replies
4
Views
446
  • Advanced Physics Homework Help
Replies
3
Views
2K
Replies
5
Views
4K
Replies
2
Views
1K
Replies
2
Views
1K
Replies
1
Views
142
Replies
3
Views
798
  • Introductory Physics Homework Help
Replies
7
Views
1K
Back
Top