Vector rotation (possibly Euler angles)

AI Thread Summary
The discussion focuses on methods for rotating a 3D vector while maintaining its magnitude and positioning it at a specific 3D point. Euler angles are explored as a potential solution, with a detailed explanation of the rotation matrices for the x and y axes. The process involves applying these matrices sequentially to achieve the desired rotations, exemplified by rotating a vector by 45 degrees around both axes. Additionally, it emphasizes the need to calculate both the new orientation of the vector and its new position after rotation. The conversation concludes with a confirmation that the provided explanations were helpful.
kevdoig
Messages
9
Reaction score
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
The Euler angles is one way of doing it. If you set

D=<br /> \begin{pmatrix}<br /> \cos\phi &amp; \sin\phi &amp; 0\\<br /> -\sin\phi &amp; \cos\phi &amp; 0\\<br /> 0 &amp; 0 &amp; 1<br /> \end{pmatrix}<br /> C=<br /> \begin{pmatrix}<br /> 1 &amp; 0 &amp; 0\\<br /> 0 &amp; \cos\theta &amp; \sin\theta\\<br /> 0 &amp; -\sin\theta &amp; \cos\theta<br /> \end{pmatrix}<br /> B=<br /> \begin{pmatrix}<br /> \cos\psi &amp; \sin\psi &amp; 0\\<br /> -\sin\psi &amp; \cos\psi &amp; 0\\<br /> 0 &amp; 0 &amp; 1<br /> \end{pmatrix}<br />

Then the full rotation by the 3 angles are given by A=BCD. Then if your vector is x your rotated vector becomes x&#039;=Ax. 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 C matrix is the identity matrix and \phi=\psi=\pi/4
 
Last edited by a moderator:
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.
 
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
R(\theta) = \begin{pmatrix}<br /> \cos\theta &amp; -\sin\theta\\<br /> \sin\theta &amp; \cos\theta\\<br /> \end{pmatrix}
The identity transformation leaves all values the same. For 3-dimensional Euclidean space with the usual basis the identity is
\begin{pmatrix}<br /> 1 &amp; 0 &amp; 0 \\<br /> 0 &amp; 1 &amp; 0\\<br /> 0 &amp; 0 &amp; 1\\<br /> \end{pmatrix}
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).
<br /> \begin{pmatrix}<br /> 1 &amp; 0 &amp; 0 \\<br /> 0 &amp; \cos\theta &amp; \sin\theta\\<br /> 0 &amp; -\sin\theta &amp; \cos\theta\\<br /> \end{pmatrix}<br />
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).
<br /> \begin{pmatrix}<br /> \cos\theta &amp; 0 &amp; -\sin\theta \\<br /> 0 &amp; 1 &amp; 0\\<br /> \sin\theta &amp; 0 &amp; \cos\theta\\<br /> \end{pmatrix}<br />
To rotate your example by 45 degrees about the x-axis, then 45 degrees about the y-axis, we would first apply the transformation
<br /> \begin{pmatrix}<br /> \frac{\sqrt{2}}{2} &amp; 0 &amp; -\frac{\sqrt{2}}{2} \\<br /> 0 &amp; 1 &amp; 0\\<br /> \frac{\sqrt{2}}{2} &amp; 0 &amp; \frac{\sqrt{2}}{2}\\<br /> \end{pmatrix}<br />
and then the transformation
<br /> \begin{pmatrix}<br /> 1 &amp; 0 &amp; 0 \\<br /> 0 &amp; \frac{\sqrt{2}}{2} &amp; \frac{\sqrt{2}}{2}\\<br /> 0 &amp; -\frac{\sqrt{2}}{2} &amp; \frac{\sqrt{2}}{2}\\<br /> \end{pmatrix}<br />
as described above.
 
Last edited:
cheers,
exactly what i needed.

Kev
 
Seemingly by some mathematical coincidence, a hexagon of sides 2,2,7,7, 11, and 11 can be inscribed in a circle of radius 7. The other day I saw a math problem on line, which they said came from a Polish Olympiad, where you compute the length x of the 3rd side which is the same as the radius, so that the sides of length 2,x, and 11 are inscribed on the arc of a semi-circle. The law of cosines applied twice gives the answer for x of exactly 7, but the arithmetic is so complex that the...
Thread 'Unit Circle Double Angle Derivations'
Here I made a terrible mistake of assuming this to be an equilateral triangle and set 2sinx=1 => x=pi/6. Although this did derive the double angle formulas it also led into a terrible mess trying to find all the combinations of sides. I must have been tired and just assumed 6x=180 and 2sinx=1. By that time, I was so mindset that I nearly scolded a person for even saying 90-x. I wonder if this is a case of biased observation that seeks to dis credit me like Jesus of Nazareth since in reality...
Fermat's Last Theorem has long been one of the most famous mathematical problems, and is now one of the most famous theorems. It simply states that the equation $$ a^n+b^n=c^n $$ has no solutions with positive integers if ##n>2.## It was named after Pierre de Fermat (1607-1665). The problem itself stems from the book Arithmetica by Diophantus of Alexandria. It gained popularity because Fermat noted in his copy "Cubum autem in duos cubos, aut quadratoquadratum in duos quadratoquadratos, et...
Back
Top