Hi, I’m new in this forum and I have a question about how to rotate vectors.
I try to rotate the vector (0,0,1) -35 degrees in any direction. The way I have to make this rotation is as follows:
Vector3d vectorToRotate = new Vector3d(0, 0, 1); Vector3d orientation= new Vector3d(0, 1, 0); vectorToRotate.Transform(Transform.Rotation((-35*Math.PI)/180, orientation, Point3d.Origin));
If the direction of rotation is parallel to any axis the behavior of the code is as
expected, however if the address does not match any of the axes the result is
Orientation vectorToRotate behavior
(0,1,0) (-0.57, 0, 0.81) Right
(1,0,0) (0, 0.57, 0.81) Right
(0.7,0.7,0) (0.4,0.4, 0.81) Incorrect
The plane of rotation in the first two is perpendicular to the orientation vector,
however the plane of rotation is parallel to the latter orientation vector.
Someone can help me to correct this behavior?
Thanks in advance.