I know this is a VERY old thread, but I encountered this problem as well and found the only solution here.
Unfortunately, I think erissian's formula is flawed. There is a small error which kept me busy for a while, but I solved it and thought I could share the solution:
erissian wrote:
M[sub]x[/sub] = (1-s)A[sub]x[/sub] + st(A-D+C-B)[sub]x[/sub] - t(A-D)[sub]x[/sub]
M[sub]y[/sub] = (1-s)A[sub]y[/sub] + st(A-D+C-B)[sub]y[/sub] - t(A-D)[sub]y[/sub]
But it should be:
M[sub]x[/sub] = [color=#ff0000]sB[sub]x[/sub]+(1-s)A[sub]x[/sub] + st(A-D+C-B)[sub]x[/sub] - t(A-D)[sub]x[/sub]
M[sub]y[/sub] = [color=#ff0000]sB[sub]y[/sub]+(1-s)A[sub]y[/sub] + st(A-D+C-B)[sub]y[/sub] - t(A-D)[sub]y[/sub]
This simplifies to these coefficients of the quadratic equation at[sup]2[/sup] + bt + ct = 0
a = C?D+D?B+A?C+B?A
b = M?C+D?M+B?M+M?A+C?A+B?D+2(A?B)
c = M?B+A?M+B?A
I don't know if these are the same values diegovar calculated in the end, but they work