Step by step
First, initialize homogeneuous transformation matrix to identity matrix .
The full form of will be something like and vice versa depending on the question, but this just means we have to split the rotation and translation up.
If mobile is to be rotated about or translated along unit axis of fixed , we need to pre-multiply, meaning on the left side.
If Mobile is to be rotated about or translated along its own unit axis, we will post-multiply, meaning on right side.
Question Example


- in the above , we should write it as instead, which is better
Whichever comes first, goes into the equation first. So in the above example, we translate along first then rotate about , so will be closer to than