For the following system:

x1 := M*(cos(phi)-a*cos(phi)) / (1-b*cos(2*phi))

x2 := M*(cos(phi)+a*sin(phi)) / (1+b*sin(2*phi))

y1 := M*(sin(phi)+a*sin(phi)) / (1-b*cos(2*phi))

y2 := M*(sin(phi)+a*cos(phi))/ (1+b*sin(2*phi))

I'm solving for M(x1,x2,y1,y2), eliminating a, b, and phi.

I've tried

solve({x1=X1, x2=X2, y1=Y1, y2=Y2},{M,a,b,phi},AllSolutions);

and

sol := eliminate({x1 = X1, x2 = X2, y1 = Y1, y2 = Y2}, {M, a, b, phi});

ans := simplify(eval(M, sol[1]), size)

Both yield unwieldy solutions. I'd like to have a tight solution if possible.