Points X, Y, and Z are on the sides QR , PR, and PQ respectively, of right triangle PQR such that PZXY is a square. If PQ=12 and PR=8, then what is the side length of the square?
[asy]
pair A, B,C,D,EE,F;
A = (0,0);
B = (1.2,0);
C = (0,0.8);
F = (Tan(25.6), 0);
EE = (0, Tan(25.6));
D = EE + F;
draw(rightanglemark(F,A,EE,1.5));
draw(EE--D--F--A--C--B--F);
label("$P$",A,SW);
label("$Q$",B,SE);
label("$R$",C,NW);
label("$X$",D,NE);
label("$Y$",EE,W);
label("$Z$",F,S);
[/asy]
Points X, Y, and Z are on the sides QR, PR, and PQ respectively, of right triangle PQR such that PZXY is a square. If PQ=12 and PR=8, then what is the side length of the square?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Triangles PQR and ZQX are similar!
Square side => a
XZ / (PQ - PZ) = PR / PQ
a / (12 - a) = 8 / 12
a = 4.8