Signed angle between two 3D vectors

In summary, you need to find the signed angle between two vectors. You can find this by using the arccos function. However, you may need to use the negative z-axis to do this if the vectors are in a plane that is rotated 90 degrees from the positive z-axis.
  • #1
cakeathon
3
0
Hi all, I am looking for some help please.

I want to calculate the signed angle between two 3D (x,y,z) vectors. I know the formula to find the unsigned angle;

angle = arccos(A.B / |A||B|)

but how do I get the signed angle? From searching through the internet it seems that there isn't an obvious/easy solution ?


To clarify: Assume the two vectors can lie on any plane. Taking the first vector as a reference I want to know the angle that I would need to rotate the first vector to line it up with the second vector.


Can someone more clever than me point me in the right direction, or prehaps offer a solution please ?
 
Physics news on Phys.org
  • #2
The sign of the angle depends on the axis you use.

Take the angle between x = (0, 1, 0) and y = (1, 0, 0). We see that y is actually x rotated 90 degrees along the z axis (described by the vector (0, 0, 1)). But we can equivalently say that y is x rotated -90 degrees through the negative z axis (described (0, 0, -1)).

Suppose you have two points, p1 and p2, such that p2 is p1 rotated in some plane. A plane is uniquely specified by three points (assuming that all three are distinct and do not lie on a single line). The plane of our rotation is defined by the origin, p1, and p2.

The axis about which they rotate is the normal of this plane. Each plane actually has two normals (a positive one and a negative one), which can be found by taking either the left-handed or right-handed cross product of p1 and p2.

Once you have chosen which axis you want, you can define positive rotation to be the usual counter-clockwise direction along that axis.
 
  • #3
Thanks Tic Tac, I understand what you are saying. Let me give you an example of my problem:

keeping things simple for my small brain, we have two vectors on (lets say) the xy plane
vec1 = 1,0,0
vec2 = 1,1,0

the cross product, CP = 0,0,+1 (in the 'positive' direction) and the angle between them is 45 degress. (Using right hand rule, vec1 is rotated counter clockwise around CP by 45 degrees to align with vec2). Perfect.


now let's say vec2 = -1,1,0. CP is still 0,0,+1 and the angle is +135 degrees. Perfect.

now let's say vec2 = -1,-1,0. But now the CP flips to the other direction and CP is now 0,0,-1 (in the 'negative' direction) and the angle is +45. But actually I want the angle answer to be -45.


So maybe the question I should ask is how do I work out if the Cross Product of my two vectors is in the 'postive' direction rather than the 'negative' direction for the plane defined by my two vectors. In the real world this plane can be in any orientation.
 
  • #4
now let's say vec2 = -1,-1,0. But now the CP flips to the other direction and CP is now 0,0,-1 (in the 'negative' direction) and the angle is +45. But actually I want the angle answer to be -45.

You can't have your cake that way.

As long as you've fixed your cross product's handedness, there will be situations where the normal flips. It may look inconvenient to you, but it ensures that the cross product is continuous and the angles are defined in a consistent way.

It might help to realize there is no general distinction between the "negative" normal and the "positive" one. For the z-axis, it makes sense, but take a pair of vectors like [1, 1, 0] and [0, 1, 1]. The two normal possibilities are then [1, -1, 1] and [-1, 1, -1], and it's not clear either is "positive". The best you can do is say one is right-handed versus left handed.

Also, note the property of the cross product that it is anti-commutative. For all a and b, a x b = -(b x a).
 
  • #5
Tac-Tics said:
It might help to realize there is no general distinction between the "negative" normal and the "positive" one. For the z-axis, it makes sense, but take a pair of vectors like [1, 1, 0] and [0, 1, 1]. The two normal possibilities are then [1, -1, 1] and [-1, 1, -1], and it's not clear either is "positive". The best you can do is say one is right-handed versus left handed.

Yes that does help, I can see your point. Thankyou :smile:
 
  • #6

Related to Signed angle between two 3D vectors

1. What is a "signed angle" between two 3D vectors?

A signed angle is a measurement of the angle between two 3D vectors that takes into account the directionality of the vectors. This means that the angle can be positive or negative, depending on the orientation of the vectors.

2. How is the signed angle between two 3D vectors calculated?

The signed angle between two 3D vectors can be calculated using the dot product formula or the cross product formula. The dot product formula involves taking the inverse cosine of the dot product of the two vectors, while the cross product formula involves taking the inverse tangent of the magnitude of the cross product of the two vectors.

3. What is the difference between a signed angle and an unsigned angle?

An unsigned angle is the absolute value of the angle between two vectors, meaning it does not take into account the directionality of the vectors. A signed angle, on the other hand, can be positive or negative and reflects the orientation of the vectors in relation to each other.

4. Why is it important to consider the signed angle between two 3D vectors?

In some cases, the direction or orientation of two vectors can be just as important as the angle between them. For example, in physics and engineering applications, the orientation of forces or velocities can greatly affect the outcome of a calculation. By considering the signed angle, we can get a more accurate understanding of the relationship between the vectors.

5. How is the signed angle between two 3D vectors used in practical applications?

The signed angle between two 3D vectors is commonly used in 3D graphics, robotics, and navigation systems. It can also be applied in physics and engineering calculations, such as determining the torque or angular velocity of an object. Additionally, it is used in computer algorithms for tasks such as 3D object recognition and motion planning.

Similar threads

Replies
26
Views
2K
Replies
7
Views
2K
  • Differential Geometry
Replies
3
Views
2K
Replies
10
Views
769
Replies
9
Views
1K
Replies
4
Views
218
  • Introductory Physics Homework Help
Replies
14
Views
361
Replies
14
Views
1K
  • Introductory Physics Homework Help
Replies
26
Views
2K
Replies
4
Views
161
Back
Top