When a triangle is inscribed in a semicircle where a diameter of the circle is a side of the​ triangle, the triangle formed is always a right triangle. If an isosceles triangle​ (two equal​ sides) is inscribed in a semicircle with a radius of 9 ​inches, find the length of the two legs of the triangle.