Answer:
[tex] {x}^{2} + {x}^{2} = {(3 \sqrt{2} )}^{2} \\ 2 {x}^{2} = 18 \\ {x}^{2} = \frac{18}{2} \\ {x}^{2} = 9 \\ \boxed{x = 3}[/tex]
Therefore the length of the legs is 3.