On CAD software it is possible to copy a drawing $A$ with points, lines, ... (with UCS A) to a drawing $B$ (with UCS B) specifying a origin point on drawing $A$ and a destination point on drawing $B$.
For example on drawing $A$ there are points $A_1 (A_{1x}, A_{1y}, A_{1z})$ and point $A_2 (A_{2x}, A_{2y}, A_{2z})$ besides there is a UCSA (CAD define this with A origin $OA_x, OA_y, OA_z$ and $2$ unit vectors for $X$-axis and $Y$-axis directions: Link.
On drawing $B$ there are points $B_1 (B_{1x}, B_{1y}, B_{1z})$ and a UCSB (CAD define as UCSA).
On CAD I can copy $A_2$ from drawing $A$ to drawing $B$ using $A_1$ as origin and $B_1$ as destination. CAD software will use the UCSA and UCSB to transform the point before copy.
My question is: which algorithm the CAD software use to do it?
Usually, coordinate systems are related by a change of origin and isotropic rescaling (and/or change of unit),
$$\begin{cases}x'=sx+p,\\y'=sy+q\end{cases}$$
or a similarity (if there is a rotation in between)
$$\begin{cases}x'=ux+vy+p,\\y'=vx-uy+q.\end{cases}$$
You can determine the coefficients by taking enough pairs of corresponding points, giving their coordinates in both frames and solving the equations for the unknown coefficients.
When geographic coordinates on a large scale are involved, the transformations are much more complex.
Similar equations hold for 3D. The rotation is expressed by a $3\times3$ orthogonal matrix.