Registered Member
|
I have a vector:
Vector3f v(3,11,0) How do i rotate this vector anticlockwise with its starting position at point(2,3,0) and get the new end point of newly rotated vector using eigen? |
Registered Member
|
I'm sorry if I don't understand the question, but the wording is ambiguous.
If you want to transpose this vector, run this code:
or
Note that you can't save the result to v, because it's a Vector3f, a 3 by 1 matrix of floats, and the transpose is a 1 by 3 matrix. You would have to save it to another variable like so to save it:
If you want to rotate the coordinates of the vector around one or more axes, that would entail multiplying the vector by one or more "rotation matrix". you can consult Wikipedia on how to build a general set of 3 rotation matrices in 3 dimensions, and in which order to multiply them: https://en.wikipedia.org/wiki/Rotation_matrix#In_three_dimensions Note that the θ symbol represents the angle of rotation by the right hand rule (look at the direction your fingers curl when pointing your thumb in the positive direction along the axis of interest): https://en.wikipedia.org/wiki/Right-hand_rule#Coordinates |
Registered users: bartoloni, Bing [Bot], Google [Bot], Yahoo [Bot]