A homeowner is building a square fence around his circular patio so that each side of the fence is tangent to the circle, as shown in the diagram below. The radius of his patio is 18 yards. What is the perimeter of his fence?