How do you find the angle between 2 vectors

Status
Not open for further replies.

TecHNooB

Diamond Member
Sep 10, 2005
7,458
1
76
Trying to prove the dot product using a combination of phi and theta (spherical coordinates). I know the proof for the 2-d case but I would like to extend it to the 3-d case.

Edit: Maybe not.
 

eLiu

Diamond Member
Jun 4, 2001
6,407
1
0
Form the vector that connects the two (i.e. make a triangle). Use whatever trig relations you like (law of cosines/sines, for example). Law of cosines or law of sines are pretty easy to prove; see wiki for details.
 

CycloWizard

Lifer
Sep 10, 2001
12,348
1
81
This page covers it pretty well if eLiu's explanation didn't get you there. It basically reiterates what he said, but also gives it to you in terms of vector notation using dot products and norms.
 

TecHNooB

Diamond Member
Sep 10, 2005
7,458
1
76
Originally posted by: eLiu
Form the vector that connects the two (i.e. make a triangle). Use whatever trig relations you like (law of cosines/sines, for example). Law of cosines or law of sines are pretty easy to prove; see wiki for details.

I tried this and got stuck. Ideally, I want to relate the angles. I want to describe the angle between 2 vectors in terms of phi and theta used in spherical coordinates.
 

CycloWizard

Lifer
Sep 10, 2001
12,348
1
81
Originally posted by: TecHNooB
Originally posted by: eLiu
Form the vector that connects the two (i.e. make a triangle). Use whatever trig relations you like (law of cosines/sines, for example). Law of cosines or law of sines are pretty easy to prove; see wiki for details.

I tried this and got stuck. Ideally, I want to relate the angles. I want to describe the angle between 2 vectors in terms of phi and theta used in spherical coordinates.
In that case, you can just compute the angles by converting the vector components to spherical coordinates, then taking the difference (i.e. calculate theta_1 and phi_1 for vector 1, then theta_2 and phi_2 for vector 2, then compute theta*=theta_1-theta_2, phi*=phi_1-phi_2).
 

TecHNooB

Diamond Member
Sep 10, 2005
7,458
1
76
Originally posted by: CycloWizard
Originally posted by: TecHNooB
Originally posted by: eLiu
Form the vector that connects the two (i.e. make a triangle). Use whatever trig relations you like (law of cosines/sines, for example). Law of cosines or law of sines are pretty easy to prove; see wiki for details.

I tried this and got stuck. Ideally, I want to relate the angles. I want to describe the angle between 2 vectors in terms of phi and theta used in spherical coordinates.
In that case, you can just compute the angles by converting the vector components to spherical coordinates, then taking the difference (i.e. calculate theta_1 and phi_1 for vector 1, then theta_2 and phi_2 for vector 2, then compute theta*=theta_1-theta_2, phi*=phi_1-phi_2).

That result looks vectorized. I just want a number.
 

Schmide

Diamond Member
Mar 7, 2002
5,684
912
126
If i remember right. If you normalize the vectors, then compute the cross product, the magnitude of the resulting vector is the arcsin of the angle between the two original vectors.
 

eLiu

Diamond Member
Jun 4, 2001
6,407
1
0
Originally posted by: TecHNooB
Originally posted by: eLiu
Form the vector that connects the two (i.e. make a triangle). Use whatever trig relations you like (law of cosines/sines, for example). Law of cosines or law of sines are pretty easy to prove; see wiki for details.

I tried this and got stuck. Ideally, I want to relate the angles. I want to describe the angle between 2 vectors in terms of phi and theta used in spherical coordinates.

To relate the angles, I'm 99% sure you'll end up having to just convert them to cartesian coordinates. Sphereical coords really are not built for planar geometry (which is probably the most direct way of solving your problem--treat it as a triangle in a plane).

(Note that you could also treat it as a plane in polar coordinates, but you'd have to perform coordinate rotations to do that... which involve dot products. The difficulty here is that it's difficult to work in arbitrary coordinates; you're much better off rotating into a simpler coordinate system.)

Edit: can I ask why you want to avoid the dot product? Dot products just embody the operation of taking two lines, making one of them the hypotenuse of a right triangle, and using trigonometry.
 

TecHNooB

Diamond Member
Sep 10, 2005
7,458
1
76
Originally posted by: eLiu
Originally posted by: TecHNooB
Originally posted by: eLiu
Form the vector that connects the two (i.e. make a triangle). Use whatever trig relations you like (law of cosines/sines, for example). Law of cosines or law of sines are pretty easy to prove; see wiki for details.

I tried this and got stuck. Ideally, I want to relate the angles. I want to describe the angle between 2 vectors in terms of phi and theta used in spherical coordinates.

To relate the angles, I'm 99% sure you'll end up having to just convert them to cartesian coordinates. Sphereical coords really are not built for planar geometry (which is probably the most direct way of solving your problem--treat it as a triangle in a plane).

(Note that you could also treat it as a plane in polar coordinates, but you'd have to perform coordinate rotations to do that... which involve dot products. The difficulty here is that it's difficult to work in arbitrary coordinates; you're much better off rotating into a simpler coordinate system.)

Edit: can I ask why you want to avoid the dot product? Dot products just embody the operation of taking two lines, making one of them the hypotenuse of a right triangle, and using trigonometry.

I'm trying to see why multiplying the scalars for each vector component and summing is equal to the magnitude of the projection of one vector times the magnitude of the other. There's a fairly easy derivation for the 2 dimensional case, but I want to prove it in the 3-d case.

Edit: Essentially, I can't prove the dot product with the dot product. The magnitude of the projection times the magnitude is the intuitive way to think about dot product (in my opinion). I want to see why AxBx + AyBy+ AzBz gives me the same result.
 

Schmide

Diamond Member
Mar 7, 2002
5,684
912
126
If you can get past the fact that the magnitude of a vector is the sqrt of the of a vector dot product with itself, you can determine the angle to be equal to the arccos of the limit of the sum of the magnitudes of the arc-normalized midpoint distances.

angle = arccos (limit of the sum( || ( ( ( ( (An - Bn)/2) + Bn ) / || ( (An - Bn)/2) + Bn) ) || ) - Bn || )

Basically representing the orthodontic distance as a infinitesimal series of vector magnitudes. In essence using Euler method to compute the distance of arc between the two vectors.

Edit: as in all math I made a buncho mistakes.
 
Status
Not open for further replies.