HELMERTT - HELMERT transformation v1.1
F.Reichert <f.rei@gmx.de> 
June 30 1997

{[v2]..[v2]} {[v2]..[v2]} {[v2]..[v2]}    ---->     {tx ty sc rot} {[v2]..[v2]}

Helmert transformation is a 4 parameter transformation ( 2 translations,  1 ro-
tation, 1 scale) between two plain coordinate systems. 
This transformation is overdetermined in case of  more than 2 control points in 
each system. A solution that satisfies all transformation inputs may not exist. 
HELMERTT returns  the solution  with  the minimum  residuals of control points.

Input:
HELMERTT requires three lists of two-dimensional vectors as arguments.  Put the 
control points  into  stack level  3 and 2,  but  make sure that  the number of 
points in both source and destination system are identical,  and the points it-
self are in same order.  Level 3  holds  the points to be transformed.

Output:
After evaluating  HELMERTT  you'll get transformed points in  stack level 1 and 
transformation parameters in the 2nd level.

Example:

4:
3:{[1 2] [3 4] [5 6]}    <-- CP's in source system
2:{[2 4] [6 8] [10 12]}  <-- CP's in destination system
1:{[1 1] [1 2]}          <-- points to transform

If you have  stored some points  in variables (e.g. P: [1 2] ) your stack could 
look like this:

4:
3:{ P [3 4] [5 6]}
2:{[2 4] [6 8] [10 12]}
1:{[1 1] P }
HELM| P |   |   |   |