I have two Shapes, each defined as a single SVG Path. I want to find if Shape A is an Affine Transform of Shape B and also compute/find the Affine transform matrix. My current approach computes the consecutive Angles between off curve and on curve points to find if they are transformed shapes. This works for translate,scale,rotate operations. But does not work for sheared Shapes.
Any proper mathematical approaches are available?
You can find matrix of affine transform between any triplet of non-collinear points P1,P2,P3 and their translated twins P1',P2',P3'
To calculate A, it is needed to multiply both sudes by inverse of P matrix
A * P * P-1 = P' * P-1
A * E = P' * P-1
A = P' * P-1
Then check that the same A works for other triplets of points (for random subset or for all points, if possible)
There are sophisticated methods to evaluate affine transform for the whole point cloud, but they are more complex.