0
  1. The 3D coordinates of the vector.

  2. The rotation angle in radians.

  3. The 3D coordinates of a point of the axis.

  4. 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?

natikos
  • 111
  • 9
  • [This SO question](https://stackoverflow.com/questions/14607640/rotating-a-vector-in-3d-space) might help you – IDarkCoder Jun 19 '19 at 14:13

1 Answers1

0

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))
MBo
  • 77,366
  • 5
  • 53
  • 86