Suppose you given three points with known coordinates $P_1, P_2, P_3$, and also another set of three points $P'_1, P'_2, P'_3$. Now does there always exist an affine transformation
$ f( r ) = A r + b $
where $A \in \mathbb{R}^{ 3 \times 3}$ and $b \in \mathbb{R}^3 $, that will map $P_1$ to $P'_1$, $P_2$ to $P'_2$ and $P_3$ to $P'_3$ ?
My attempt:
The affine transformation can be written as
$ f(r) = A (r - P_1) + P'_1 $
For $3 \times 3$ matrix $A$ , this automatically satisfies the first condition.
Now, we have to find $A$ such that
$ A( P_2 - P_1) + P'_1 = P'_2 $
$ A( P_3 - P_1) + P'_1 = P'_3 $
i.e.
$ A [ (P_2 - P_1) , (P_3 - P_1) ] = [ (P'_2 - P'1) , (P'_3 - P'_1) ] $
Let $G = [(P_2 - P_1) , (P_3 - P_1) ], H = [ (P'_2 - P'1) , (P'_3 - P'_1) ] $, then
$G$ and $H$ are $3 \times 2$, and
$ A G = H $
Transposing,
$ G^T A^T = H^T $
Let $B = A^T = [b_1, b_2, b_3] $ then these unknown columns are solutions of three linear systems,
$ G^T b_1 = h_1 $
$ G^T b_2 = h_2 $
$G^T b_3 = h_3 $
Note that $G^T$ is $2 \times 3$ and the $h_i$ are $2 \times 1$ vectors.
A solution will exist for all these systems if $h_1, h_2, h_3$ belong to the column space of $G^T$, which is a mild condition, and is satisfied in most cases.
With this , we get
$ b_i = V_i + \lambda_i W_i $
where $\lambda_i \in \mathbb{R} $.
Thus we have $3$ degrees of freedom in choosing the columns of $A^T$, i.e. the rows of $A$.
I would appreciate it if someone could go through the above analysis and verify that it is correct.
Thank you all.
Extend $P_2-P_1,P_3-P_1$ to a basis $P_2-P_1,P_3-P_1,v$ then your choice of where the first two vectors is sent is forced, but you can send $v$ anywhere. Thus, in this basis, the third column of the matrix $A$ is arbitrary, leaving three degrees of freedom.