0
$\begingroup$

I'm trying to rotate a vector that is at the origin {0,0,0} around an arbitrary axis (in this case the rotation is around {40,30,30} through {40,31,30}).

The problem appears to be that I can't rotate a {0,0,0} vector, because it always remains 0. I remedied this by moving it towards the point I want to rotate around ({40,30,30}) and moving it back after the rotation.

However, I don't know if this is the right way to do it, and I'm having a hard time finding anything about it.

As far as I understand, the translation towards the origin before rotation should take care of the problem that the vector to rotate is at the origin itself, but it doesn't appear to be working as such.

It's software that I wrote myself, so it's possible I messed something up. But I'm really not sure anymore.

$\endgroup$
  • $\begingroup$ Sometimes we view vectors as just an arrow that has length and direction. Sometimes we view them as an arrow with the root attached to some point in space. The first is more common. For the first the only rotation you can do is to change the direction of the vector. As you say, you can't rotate a zero length vector because it has no direction. For the second, you can rotate the location of the root of the vector even if it is the zero vector. $\endgroup$ – Ross Millikan Mar 17 '18 at 15:33
  • $\begingroup$ If you say the vector is at $(0,0,0)$ that could mean it is the zero vector with zero length or it could mean you are regarding the root as being at the origin but the head is somewhere else. You need to make clear what you are trying to do. $\endgroup$ – Ross Millikan Mar 17 '18 at 15:33
  • $\begingroup$ It is a zero vector with zero length. Since I'm trying to rotate it around a different axis, it should still be possible to move it, right? I'm not trying to rotate it around the origin, but around a different vector in space. $\endgroup$ – ihendriks Mar 17 '18 at 15:42
  • $\begingroup$ The zero vector has no length, hence it has no angle with. rotating it will not change anything because it can be view as a point. If you want to rotate a vector that start at $(0,0,0)$: en.wikipedia.org/wiki/Rotation_matrix#In_three_dimensions and mathworld.wolfram.com/RodriguesRotationFormula.html $\endgroup$ – Holo Mar 17 '18 at 16:06
0
$\begingroup$

You can certainly rotate the point $(0,0,0)$ around your axis. Your axis is parallel to $y$ and offset from the origin by $50$ units. The easiest way to do this is to translate your axis and all of space to put the axis through the origin, rotate the space, and translate back. Your translation is then by $(-40,0,-30)$ so your zero vector moves to $(-40,0,-30)$. Now if you rotate this by an angle $\theta$ it becomes $(-40 \cos \theta -30 \sin \theta,0,30 \sin \theta -40 \cos \theta)$ if our sign conventions agree. Translating back then gives your final point as $(40-40 \cos \theta -30 \sin \theta,0,30+30 \sin \theta -40 \cos \theta)$

$\endgroup$
  • $\begingroup$ This is what I'm doing right now, but it's not working. I assume there's a mistake in my code somewhere, or possibly that I'm doing some translations in the wrong order. Thanks for at least confirming what I thought I had to do. $\endgroup$ – ihendriks Mar 17 '18 at 16:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.