# Rotate & Translate a MatrixTRS

Hello I have a question about translation & rotation of a MatrixTRS...

So basicly I have a given MatrixTRS A in space, define by a positionA, rotationA and scaleA. (DISCLAIMER: I am using Unity, but I do not use Transform, therefore I have a Matrix4x4, created like that: Matrix4x4 A = Matrix4x4.TRS(position, rotation, scale);

Ok, Now I have a Point in space, with a given rotation, named PositionB, and RotationB. I would like to translate & Rotate my TRS matrix to that positionB, and rotationB.

I know I have to do something like b.transform.TransformPoint() and Quaternion.Inverse(b.transform.rotation)*a.transform.rotation, but i didn't manage to make it right yet.

Thanks!

• If you're replacing both the translation and the rotation, could you not simply recalculate using the TRS method, as Matrix = Matrix4x4.TRS(PositionB, RotationB, ScaleA)? Or have I misunderstood your use case? Want to try diagramming what you need? – DMGregory Nov 18 '20 at 18:14