Let the first right triangle be ABC where A is the right angle and BC the hypotenuse of length a.
If BC is the longer leg of the second right triangle and CD is the shorter leg, the longer hypotenuse is BD of length x, and the right angle is BCD. BD=x=8cm. CBD=BCA=30 and BD is parallel to AC, making BDCA a trapezoid. Also a/x=cos30=√3/2.
So a=8×√3/2=4√3 cm. the longer leg of ABC, the smaller triangle, is AC. AC/a=cos30=√3/2, so AC=a√3/2=(4√3)√3/2=6 cm.