Java tutorial
//package com.java2s; //License from project: Apache License import android.graphics.Matrix; public class Main { /** * Calculates the transformation matrix according to M(transformation) * M(source) = M(target). * * @param source source matrix * @param target target matrix * @return delta matrix */ public static Matrix getTransformationMatrix(Matrix source, Matrix target) { Matrix delta = new Matrix(); source.invert(delta); delta.postConcat(target); return delta; } }