Vector rotation (possibly Euler angles)

In summary, the conversation discusses the use of Euler angles to rotate a 3D vector without changing its magnitude and attach it to an arbitrary 3D point. The conversation also provides an example of using rotation matrices for x, y, and z axis rotations and explains how to calculate Euler angles for a specific rotation.
  • #1
kevdoig
9
0
I'm looking for a method to rotate a 3D vector, and place it at an arbitary 3D point (x,y,z) without changing the vectors magnitude. I have briefly investigated eulers angles (mainly through wikipedia links etc), but don't fully understand the process yet.

As an example, given the vector : (3.6,1.6,0)

How could i rotate this by 45degrees on X axis.

Then again by 45degrees on the Y axis, as a separate rotation.

I would then like to visualise this vector at point (1,1,1), on a 3D plot i have created.(not sure if this effects anything...)
 
Mathematics news on Phys.org
  • #2
The Euler angles is one way of doing it. If you set

[tex]D=
\begin{pmatrix}
\cos\phi & \sin\phi & 0\\
-\sin\phi & \cos\phi & 0\\
0 & 0 & 1
\end{pmatrix}
C=
\begin{pmatrix}
1 & 0 & 0\\
0 & \cos\theta & \sin\theta\\
0 & -\sin\theta & \cos\theta
\end{pmatrix}
B=
\begin{pmatrix}
\cos\psi & \sin\psi & 0\\
-\sin\psi & \cos\psi & 0\\
0 & 0 & 1
\end{pmatrix}
[/tex]

Then the full rotation by the 3 angles are given by [tex]A=BCD[/tex]. Then if your vector is [tex]x[/tex] your rotated vector becomes [tex]x'=Ax[/tex]. The Euler angles can be defined in various ways. the above should fit with the figure here http://www.imada.sdu.dk/~bolind/euler-angles.ps" . Thus your [tex]C[/tex] matrix is the identity matrix and [tex]\phi=\psi=\pi/4[/tex]
 
Last edited by a moderator:
  • #3
thanks,
my problems lies in how to calculate the euler angles for the rotation. If possible, could you maybe use an example (say, vector (3,2,0)) and show how to calculate the euler angles for a rotation of 30degrees x-axis, 20 degress y-axis, and 45 degrees z-axis for example.
Sorry if I'm missing something simple, but I'm new to eulers angles etc.
 
  • #4
If you are attaching the vector to a point, you actually need to find two separate results: the new point the vector will be attached to after rotation, and the new orientation of the vector. If we call the position vector of the point the vector is attached to p, and the vector v, then these can be combined into getting the new position of the position vector p + v.
If you have the two rotation matrices X (some rotation about the x-axis) and Y (some rotation about the y-axis), then to get the new position, we just find YX(p + v) = YXp + YXv.
A rotation about one axis in 3-space is just a rotation in 2-space along with making sure nothing happens in the third dimension. Ie., a rotation about the x-axis is actually a rotation in the yz-plane where we make sure nothing happens to the x information.
A rotation matrix for a plane looks like
[tex]R(\theta) = \begin{pmatrix}
\cos\theta & -\sin\theta\\
\sin\theta & \cos\theta\\
\end{pmatrix}[/tex]
The identity transformation leaves all values the same. For 3-dimensional Euclidean space with the usual basis the identity is
[tex]\begin{pmatrix}
1 & 0 & 0 \\
0 & 1 & 0\\
0 & 0 & 1\\
\end{pmatrix}[/tex]
which is just the ordered list of basis vectors. We want to the y and z basis vectors, but leave the x basis vector the same, so we replace the lower right hand block, the identity for vectors in the yz-plane, with the rotation matrix R(\theta) above adjusted to rotate in the right-handed orientation (the old matrix rotates counterclockwise because we usually talk about rotations of some angle "from the positive x-axis". In 3 dimensions, we usually refer to clockwise rotations about an axis, so the angles are negated, which only affects the odd function sine).
[tex]
\begin{pmatrix}
1 & 0 & 0 \\
0 & \cos\theta & \sin\theta\\
0 & -\sin\theta & \cos\theta\\
\end{pmatrix}
[/tex]
For rotation about the y-axis, or rotation in the xz-plane, we replace the 4 values corresponding to the identity block for the xz-plane with the rotation matrix (see the matrix like a torus, the screen of an Asteroids game).
[tex]
\begin{pmatrix}
\cos\theta & 0 & -\sin\theta \\
0 & 1 & 0\\
\sin\theta & 0 & \cos\theta\\
\end{pmatrix}
[/tex]
To rotate your example by 45 degrees about the x-axis, then 45 degrees about the y-axis, we would first apply the transformation
[tex]
\begin{pmatrix}
\frac{\sqrt{2}}{2} & 0 & -\frac{\sqrt{2}}{2} \\
0 & 1 & 0\\
\frac{\sqrt{2}}{2} & 0 & \frac{\sqrt{2}}{2}\\
\end{pmatrix}
[/tex]
and then the transformation
[tex]
\begin{pmatrix}
1 & 0 & 0 \\
0 & \frac{\sqrt{2}}{2} & \frac{\sqrt{2}}{2}\\
0 & -\frac{\sqrt{2}}{2} & \frac{\sqrt{2}}{2}\\
\end{pmatrix}
[/tex]
as described above.
 
Last edited:
  • #5
cheers,
exactly what i needed.

Kev
 

1. What is vector rotation?

Vector rotation is the process of changing the orientation of a vector in a three-dimensional space. It involves rotating the vector around a specific axis by a certain angle.

2. What are Euler angles?

Euler angles are a set of three angles used to represent the orientation of a rigid body in a three-dimensional space. They are typically denoted as α, β, and γ and are also known as roll, pitch, and yaw angles.

3. Why are Euler angles used for vector rotation?

Euler angles are commonly used for vector rotation because they provide a simple and intuitive way to represent the orientation of a vector. They also allow for rotations to be performed in a specific order, making it easier to achieve the desired orientation.

4. What is the difference between intrinsic and extrinsic Euler angles?

Intrinsic Euler angles refer to rotations that are performed around the axes of the rotating object. Extrinsic Euler angles, on the other hand, refer to rotations that are performed around the fixed axes of the reference frame.

5. Are there any limitations to using Euler angles for vector rotation?

Yes, there are some limitations to using Euler angles for vector rotation. One limitation is the issue of gimbal lock, where certain orientations cannot be achieved using a specific sequence of rotations. Additionally, Euler angles can be prone to numerical errors and can be difficult to visualize in complex rotations.

Similar threads

Replies
1
Views
1K
Replies
4
Views
2K
Replies
2
Views
1K
  • General Math
Replies
1
Views
3K
  • Classical Physics
Replies
1
Views
791
  • General Math
Replies
3
Views
2K
  • General Math
Replies
1
Views
699
  • Classical Physics
Replies
1
Views
739
Replies
3
Views
2K
Back
Top