/** * Computes the transformation matrix by * solving the two systems of linear equations * defined by the control point mappings, * if this is possible. * * @return true if the transformation matrix is solvable */ private boolean compute() { double[] bx = new double[] { dest0.x, dest1.x, dest2.x }; double[] row0 = solve(bx); if (row0 == null) return false; m00 = row0[0]; m01 = row0[1]; m02 = row0[2]; double[] by = new double[] { dest0.y, dest1.y, dest2.y }; double[] row1 = solve(by); if (row1 == null) return false; m10 = row1[0]; m11 = row1[1]; m12 = row1[2]; return true; }