whether it’s 74.89, 30.29, 38.16 or 66.73

Let [tex]l[/tex] be the length of one leg, and [tex]h[/tex] be the length of the hypothenuse. Finally, let [tex]\alpha[/tex] be the measure of the angle between them. Then, the following relation holds:
[tex] l = h\cos(\alpha)[/tex]
Plugging your values, we have
[tex]34 = x\cos(27)[/tex]
Solving for x, we have
[tex] x = \dfrac{34}{\cos(27)} \approx 38.16[/tex]