0

I have two vectors in space, say v1 = [(x11,y11,z11), (x12, y12, z12)] and v2=[(x21,y21,z21), (x22,y22,z22)]. The semantic here is such that each vector represents an arrow that points from its first point to the second point.

I would like to calculate a matrix M such that v2=M*v1 and M is only a rotation+scaling+translation matrix.

This looks to me like a generic 3d graphics question that must have been solved a million times already...

Marcin
  • 7,874
  • 7
  • 45
  • 49
  • 1
    see similar [Problem superimposing and aligning 3D triangles](https://stackoverflow.com/a/52163563/2521214) You can compute `scale=|v2|/|v1|` and `translation=v2-v1` directly and orientation can be done either using rotation around perpendicular axis `cross(v1,v2)` by angle `+/-acos(dot(v1,v2)/(|v1|.|v2|))` or by solving the system of 3 equations using inverse 3x3 matrix... – Spektre Dec 19 '22 at 21:00

0 Answers0