Given non-collinear points (called the initial points) |
p1 = (x1, y1),
p2 = (x2, y2), and
p3 = (x3, y3) |
and three other points (called the image points) |
q1 = (u1, v1),
q2 = (u2, v2), and
q3 = (u3, v3) |
we seek an affine transformation T satisfying
T(p1) = q1,
T(p2) = q2, and
T(p3) = q3. |
In general, such a transformation T is determined by six parameters, a, b, c, d, e, and f, in this fashion:
T(x, y) = (u, v) means |
ax + by + e = u |
cx + dy + f = v |
|
Then the three equations
T(p1) = q1,
T(p2) = q2, and
T(p3) = q3
can be written as |
ax1 + by1 + e | | = u1 |
| cx1 + dy1 + f | = v1 |
ax2 + by2 + e | | = u2 |
| cx2 + dy2 + f | = v2 |
ax3 + by3 + e | | = u3 |
| cx3 + dy3 + f | = v3 |
|
Group together the equations containing a, b, and e, and group together the equations
continaing c, d, and f: |
ax1 + by1 + e = u1 |
ax2 + by2 + e = u2 |
ax3 + by3 + e = u3 |
|
 |
cx1 + dy1 + f = v1 |
cx2 + dy2 + f = v2 |
cx3 + dy3 + f = v3 |
| |
We are accustomed to thinking of x1, y1, u1, v1, etc., as variables, but here they are
the coordinates of the points, hence known. The variables are a, b, c, d, e, and f, the parameters of the transformation T. |
The left system of equations can be solved for a, b, amd e, the right system for c, d, and f. |
Here is a more elegant matrix formulation of the problem, |
a proof that there is a unique solution if
and only if the points p1, p2, and
p3 are non-collinear, |
and the solution. |
Given a, b, c, d, e, and f, here is the conversion to r, s, theta, phi, e, and f. |