Given that the pair of triangles are similar, then their corresponding sides are in proportion, this means that:
Substituting with the information of the diagram:
Cross multiplying:
Considering the triangle on the left, and applying the Pythagorean theorem with c = y (the hypotenuse), a = 27, and b = x (the legs), we get: