Ethereal-Software / virtual-world

Virtual world interaction
0 stars 0 forks source link

Rotating vectors #7

Open RoddoWasHere opened 4 years ago

RoddoWasHere commented 4 years ago

Rotating vectors

Problem:

Given 2 vectors in 3 dimensions and the angle between them (theta), determine the rotations required to get from v1 to v2.

image

3D Rotation

More background

Since the axis of rotation on which to rotate v1 to v2 theta radians, is the cross product of v1 and v2, an idealistic scenario would be to rotate some vector (I suspect would be (1,0,0), not sure) on the y and z axis so it is equal to the cross product vector, from which it can act as the rotational axis, on which the x rotation of theta can be applied; thus giving us the rotational (x,y,z) set. Given that the solution fits these constraints, there should be only one solution.

I suspect that the solution is ambiguous, e.i. there are multiple different rotation sets (x,y,z) that would result in the same vector result (from v1 to v2).