If I have vectors $a = (1,0,0)$, $b = (0,1,0)$, and $c=(0,0,1)$ and I want to rotate them counterclockwise at rate $r$ rad/sec around vector (1,1,1). What are the formulas for $a, b, c$?
rotate vector around another vector
-
0http://en.wikipedia.org/wiki/Rotation_operator_(vector_space) – 2011-09-23
-
0^lol *both* of their links are broken: [http://en.wikipedia.org/wiki/Rotation_operator_(vector_space)](http://en.wikipedia.org/wiki/Rotation_operator_(vector_space)) – 2011-09-23
-
0@anon Oops, I think I pasted the broken link by mistake :) – 2011-09-23
-
0weird, I just copy pasted it – 2011-09-23
-
0@Jeroen: I'm still not sure how to apply info from this page to the problem. I found the "general case" quite hard to understand. – 2011-09-23
-
1@SuperGuy If you want to rotate around some vector and not the origin, you should translate to the origin, do the rotation and retranslate. Try this reference, it gives a clear and full explanation: Rotation About an Arbitrary Axis in 3 Dimensions, http://inside.mines.edu/~gmurray/ArbitraryAxisRotation/ – 2011-09-23
2 Answers
Wiki Rotation matrix has a lot of information on rotating around X, Y, Z separately by $\alpha, \beta, \gamma$. These matrices can be multiplied together to get more complex rotations, but you will need to know how many rads to rotate around each axis.
And finally a rotation matrix that takes a vector and theta to create and can rotate a point/Vector around it. (I would like to know how this is Matrix is developed)
Rotation Matrix given Unit vector to rotate around and Theta
You will need to set up the rotation matrix $R$ and multiply $a' = Ra , b' = Rb , c' = Rc$. Use trial and error to figure +/- Theta to get clockwise rotation (This may depend on the "camera" orientation).
My own example on KA Shows a gray vector rotating around a red vector. Both are focused at the origin, so it creates a cone like shape.
As an alternative, you can use quaternions!
Quaternions are an extension of the complex numbers that very nicely represent rotations in three dimensions. If you want to rotate by an angle $\theta$ around an axis $\langle x, y, z \rangle$, you first create a quaternion as follows:
$$q = \cos(\frac{\theta}{2}) + x \sin(\frac{\theta}{2}) i + y \sin(\frac{\theta}{2}) j + z \sin(\frac{\theta}{2}) k$$
Now you can apply this to a point $a$ to rotate it:
$$a' = q a \bar{q}$$
(where the overbar indicates the "conjugate": flip the signs on every term except the first).
Note: this is a very very short overview of the math behind this. If you're working in some sort of 3D modelling software like Unity, all of this math will be implemented for you, most likely in a quaternion library. Searching for "quaternion rotation" will get you more details.