I have two vectors as Python lists and an angle. E.g.:
v = [3, 5, 0]
axis = [4, 4, 1]
theta = 1.2 # In radians.
What is the best/easiest way to get the resulting vector when rotating the v vector around the axis?
The rotation should appear to be counter clockwise for an observer to whom the axis vector is pointing. This is called the right hand rule
Take a look at http://vpython.org/contents/docs/visual/VisualIntro.html.
It provides a
vectorclass which has a methodA.rotate(theta,B). It also provides a helper functionrotate(A,theta,B)if you don’t want to call the method onA.http://vpython.org/contents/docs/visual/vector.html