Calculating Angle Between 3D Vectors: A & B

In summary, to calculate the angle between two 3D vectors, you can use the formula: cos(theta) = (a dot b) / (|a| * |b|), where a and b are the two vectors. The dot product can also be written in coordinate form as: cos(theta) = (x_a * x_b + y_a * y_b + z_a * z_b) / (sqrt(x_a^2 + y_a^2 + z_a^2) * sqrt(x_b^2 + y_b^2 + z_b^2)). Remember to use the inner product, where the dot product is the best and most succinct answer.
  • #1
Karla
5
0
Hi,

If you have 2 3d vectors a and b, i.e (1,2,3) and (3,4,5) how would you calculate the angle between them?

Thanks for any advice,
Karla
 
Mathematics news on Phys.org
  • #2
Draw a right triangle.

Edit-Nevermind, I misread the question.
 
  • #3
As far as I'm concerned, it is the same thing as doing it in R^2.
 
  • #4
Dot's the answer.
 
  • #5
Any none cryptic ways for working this out? How can the dot product be used? I know a formula for 2d angle calculating but i can't find any info for 3d? And what is R^2 exactly?
 
  • #6
Karla said:
Any none cryptic ways for working this out? How can the dot product be used? I know a formula for 2d angle calculating but i can't find any info for 3d? And what is R^2 exactly?
[itex]\Re^2[/itex] is (real) 2-space, or 2D. [itex]\Re^3[/itex] would be 3-space (3D) etc. None of the above post's were cryptic in the slightest (except the first one in which the author acknowledged was erroneous). What is the formula for calculating the cosine of the angle between any two vetors?
 
Last edited:
  • #7
Sorry, cryptic probably means i don't understand them, For the angle between 2 vectors in the past i have used,

Cos Theta = (AxBx + AyBy) / |a|*|b| then I simply did Cos-1(Theta)

I attempted to alter this formula to work with 3d vectors, but it went very wrong.

Thanks for any help, i do appreciate it.
 
  • #8
Use the inner product:
[tex]\cos(\theta) = \frac{\vec a \cdot \vec b}{|\vec a|\,|\vec b|}[/tex]
 
  • #9
And if we rewrite this in co-ordinate form (as yours is above) we have;

[tex]\cos\theta = \frac{x_{a}x_{b} + y_{a}y_{b} + z_{a}z_{b}}{\sqrt{x_{a}^{2}+y_{a}^{2}}\cdot\sqrt{x_{b}^{2}+y_{b}^{2}}}[/tex]
 
Last edited:
  • #10
Thanks very much guys :)
 
  • #11
Hootenanny said:
And if we rewrite this in co-ordinate form (as yours is above) we have;

[tex]\cos\theta = \frac{x_{a}x_{b}x_{c} + y_{a}y_{b}y_{c} + z_{a}z_{b}z_{c}}{\sqrt{x_{a}^{2}+y_{a}^{2}+z_{a}^2}\cdot\sqrt{x_{b}^{2}+y_{b}^{2}+z_{b}^2}}[/tex]

I think you have one too many vectors in there...
 
  • #12
Office_Shredder said:
I think you have one too many vectors in there...
Good catch, duly corrected. I think my fingers got carried away there :rolleyes:
 
  • #13
Hootenanny said:
And if we rewrite this in co-ordinate form (as yours is above) we have;

[tex]\cos\theta = \frac{x_{a}x_{b} + y_{a}y_{b} + z_{a}z_{b}}{\sqrt{x_{a}^{2}+y_{a}^{2}}\cdot\sqrt{x_{b}^{2}+y_{b}^{2}}}[/tex]

This should read

[tex]\cos\theta = \frac{x_{a}x_{b} + y_{a}y_{b} + z_{a}z_{b}}{\sqrt{x_{a}^{2}+y_{a}^{2}+z_{a}^{2}}\cdot\sqrt{x_{b}^{2}+y_{b}^{2}+z_{b}^{2}}}[/tex]
 
  • #14
hootenanny can't catch a break :D
 
  • #15
D H said:
Use the inner product:
[tex]\cos(\theta) = \frac{\vec a \cdot \vec b}{|\vec a|\,|\vec b|}[/tex]

While this is the best, most succinct answer, I just want to make it clear that it really is the dot-product that answers the question:
[tex]\cos(\theta) = \frac{\vec a \cdot \vec b}{\sqrt{\vec a \cdot \vec a} \sqrt{\vec b \cdot \vec b}}[/tex]

That's why: Dot's the answer.
 
  • #16
robphy said:
While this is the best, most succinct answer, I just want to make it clear that it really is the dot-product that answers the question:
[tex]\cos(\theta) = \frac{\vec a \cdot \vec b}{\sqrt{\vec a \cdot \vec a} \sqrt{\vec b \cdot \vec b}}[/tex]

That's why: Dot's the answer.

Damn it! Sorry guys; I'm gona have to stop working at the same time as posting! It lucky that not too many of these errors crop up in my work :blushing:
 

FAQ: Calculating Angle Between 3D Vectors: A & B

1. How do you calculate the angle between two 3D vectors A and B?

To calculate the angle between two 3D vectors A and B, you first need to find the dot product of the two vectors. Then, divide the dot product by the product of the magnitudes of the two vectors. Finally, use the inverse cosine function to find the angle in radians or use the inverse tangent function to find the angle in degrees.

2. What is the dot product of two 3D vectors?

The dot product of two 3D vectors is a scalar value that represents the projection of one vector onto the other. It is calculated by multiplying the corresponding components of the two vectors and then adding them together.

3. How do I find the magnitude of a 3D vector?

The magnitude of a 3D vector is calculated by taking the square root of the sum of the squares of its components. In other words, it is the length of the vector.

4. Can the angle between two 3D vectors be negative?

No, the angle between two 3D vectors cannot be negative. It is always measured as a positive value between 0 and 180 degrees (or 0 and π radians).

5. Are there any other methods to calculate the angle between 3D vectors A and B?

Yes, there are other methods to calculate the angle between two 3D vectors, such as using the cross product or using trigonometric functions. However, the method of finding the dot product and using inverse cosine or tangent is the most commonly used and efficient method.

Similar threads

Replies
9
Views
2K
Replies
2
Views
2K
Replies
6
Views
1K
Replies
2
Views
1K
Replies
1
Views
975
Replies
3
Views
3K
Replies
3
Views
2K
Replies
2
Views
1K
Back
Top