Reputation: 111
The 3D coordinates of the vector.
The rotation angle in radians.
The 3D coordinates of a point of the axis.
The 3D coordinates of the direction vector of the axis.
The length of the direction vector is greater than 1e-8.
how I should rotate input vector?
First of all, I need to move my coordinate system into another start point? I don't understand how I should rotate my vector around a direction one. And then.. I should rotate at first around x axis, then y, and then z?
Upvotes: 0
Views: 1239
Reputation: 80177
There is effective approach - using Rodrigues formula
To rotate vector V about axis with unit direction vector k by angle theta
:
Vrot = V * cos(theta) + (k x v) * sin(theta) + k * (k.dot.v) * (1 - cos(theta))
Upvotes: 0