EF = radius = EH = 9 -sqrt (27) = 9 -3 sqrt (3) = r
FD = HD
Angles EFD = EHD = 90
So by SAS, triangle EFD congruent to triangle EHD
Angle HDF = 30
ED bisects this angle
Angle EDF =15 angle FED =75
Let FD = x
By the Law of Sines
r / sin (15) = x / sin (75)
[ 9 -sqrt (27) ] / sin (15) = x / sin (75)
[ 9 -sqrt (27) ] * sin 75 / sin 15 = x (sin 75 = cos 15)
[ 9 -sqrt (27) ] * (cos 15) / (sin 15) = x
[ 9 - sqrt (27) ] * cot (15) = x
[9 - sqrt (27) ] * cot (30/2) = x
[ 9 -sqrt (27)] * [ 1 + cos 30 ] / sin 30 = x
[9 -sqrt (27) ] * [ 1 + sqrt (3) / 2 ] / [ 1/2 ] = x
[9 - 3 sqrt (3)] * [ 2 + sqrt (3)] = x
[ 18 - 6sqrt (3) + 9sqrt (3) - 9 = x
[ 9 + 3sqrt (3) ] = x = FD
Side of square = CF + FD = radius of circle + x = [ 9 - 3sqrt (3) ] + [ 9 + 3sqrt (3) ] = 18