You cannot determine the position of your workpiece with the measurements you have made. There are not enough. I assume on each touch you have an X and Y co-ordinate. To determine the angle, you would have to know at least one other point. If for instance you know where the bottom left hand corner of the piece is, then you can work out the rotation and the adjustment to put it straight.
If you wish to lay the piece on the table in any position, and have the mathmatics work out the bottom left position, then you would need to make one more touch, to determine the angle of the left hand, or bottom side of the piece, From there (if the piece in square and the included angle is 90 o, the you can work out the rest.
Perhaps the easiest way, since you have written the macro, is to run it twice with a different radius. You would then get two points on each side, and the intersection of the two is the place you are looking for.
Jim