Rotate vector around center, python

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Rotate vector around center, python

I am using VTK and Python for a project related to my studies.

I am given the following point centerOfRotation and the orientation degrees,
as well as the vector [1, 0, 0]. Now I want to rotate the vector so it
"points" in the direction specified by degrres and then translate it to the
point p.

centerOfRotation = [314.848717879, 283.085686693, 423.900139245]
degrees = [-7.93947167694, -0, 171.098864823]
vector = [1, 0, 0]

transform = vtk.vtkTransform()

transform.Translate(-centerOfRotation[0], -centerOfRotation[1],

newPos = [0]*3
transform.TransformPoint(vector, newPos)
The centerOfRotation and degrees are extracted from another program, in the
other program the second point(newPos) should be beneath the first
point(centerOfRotation). But with the code given above, the second point is
located above the center of rotation. I hope someone can point me in the
right direction. Thanks a lot !

BTW: I am given another information by the other program: YSymmetry=1. I am
not really sure what that means though.

Note: I am neither a math nor computer student and my math skills are
somewhat rusty. Right now I dont have the time to study the math, so if you
could point me in the right "coding" direction I would appreciate it :D

Sent from:
Powered by

Visit other Kitware open-source projects at

Please keep messages on-topic and check the VTK FAQ at:

Search the list archives at:

Follow this link to subscribe/unsubscribe: