# Map one point cloud to another

I have two set of M 2D points (A, B) that are scaled to <0,1> intervals in both dimensions. How can I create a mapping function, that will map the set A to the set B if I select manually few points from both sets that should be mapped to each other? I have something like this:

I select N points from both sets

A1 - B1
A2 - B2
.    .
.    .
An - Bn


From them, how to create a mapping function that can be used to map remaining points (and also maps A1 - An to B1 - Bn).

An+1 - Bn+1
.      .
.      .
Am   -  Bm


I have tried to use RBF interpolation. However, this solution is not working correctly and if selected points are close to each other (their mutual distances are short), RBF fails. I have tried various basis functions as well, some work better (cubic, multiquadric), some not at all (TPS, Gauss), but overall, it is still useless.