public static PosXYZ AffineInverseTransform(TransformParams trans, PosXYZ pos)
 {
     return(new PosXYZ(CoordAlignHelper.AffineInverseTransform(pos.Data(), trans.ToDoubles()))
     {
         Z = pos.Z
     });
 }
 public static PosXYZ AlignTransform(PosXYZ pos, double[,] trans)
 {
     return(new PosXYZ(CoordAlignHelper.Transform(pos.Data(), trans))
     {
         Z = pos.Z
     });
 }
        public static Tuple <double[, ], double> CalcAffineTransform(List <PosXYZ> pos1, List <PosXYZ> pos2)
        {
            var ret = CoordAlignHelper.AffineAlign(
                pos1.Select(p => p.X).ToArray(), pos1.Select(p => p.Y).ToArray(),
                pos2.Select(p => p.X).ToArray(), pos2.Select(p => p.Y).ToArray()
                );

            return(new Tuple <double[, ], double>(ret.Item1, ret.Item2));
        }