5 circles around a cyclic quadrilateral GeoGebra Implementation


Let ABCD be a cyclic quadrilateral.
  
  
*
  
*A circle passes through A and B and tangent to CD at E.
  
*A circle passes through B and C and tangent to AD at F. 
  
*A circle passes through C and D and tangent to AB at G. 
  
*A circle passes through D and A and tangent to BC at H. 
  
  
  Prove that EG is perpendicular to FH.


I have no idea how to do this problem. I even tried to go onto geogebra and drew the diagram, and it looks extremely messy.
Can someone help me?
 A: You can follow this construction to ensure that the circles pass through the vertices of the quadrilateral and is tangent to the opposite side.

Firstly, we need to show that from the diagram below, $EJ=EK$. If you follow the link above, you'll know that the circle passing through $A,B$ is tangent to $CD$ at $K$, and the circle through $C,D$ is tangent to $AB$ at $J$.

Now, by the Power of a Point Theorem, we know the following:
$$AE\cdot BE=(AB+BE)\cdot BE= EK^2\\
CE\cdot DE=(CD+CE)\cdot CE=EJ^2 \tag1$$
By virtue of the construction given above, we have $EJ=RE$ and $EK=SE$. We can start by showing:
$$RE\overset{?}{=}EK\tag2$$
Observe that $\triangle ARE$ is right because it is inscribed in the semi-circle $ARE$ and from the construction, we know that $\triangle BRE$ is also right. Meaning, $\triangle DES$ and $\triangle CES$ are right too. 
Thus, we can show that from $(2)$:
$$RE\overset{?}{=}EK\implies RE^2\overset{?}{=}EK^2\\
BE^2+BR^2\overset{?}{=}EK^2\tag3$$
Notice, that from the altitude of the inscribed right triangles $ARE$, we can show that:
$$\frac{BR}{AB}=\frac{BE}{BR}\implies BR^2=AB\cdot BE\\
\tag4$$
Also, notice that from $(1)$, $AB\cdot BE=EK^2-BE^2$. Now plug the new information into $(3)$ and we get:
$$BE^2+AB\cdot BE\overset{?}{=}EK^2\\
BE^2+EK^2-BE^2\overset{?}{=}EK^2\\
EK\overset{\checkmark}{=}EK \\\tag5
q.e.d$$
And since $EJ=RE$, then $EJ=EK$, which means that $RE=SE$ and the circles centered at $E$ are in actuality just one circle.

For the complete proof to the problem.
From the image below, and using the proof above, we can show that $FI=FL$ too.

Firstly, we know that the sum of the angles of the opposite corners of a cyclic quadrilateral is $=180^\circ$. Now suppose $\angle C=180^\circ-\angle A$ and $\angle D=180^\circ -\angle B$.
Since $\angle CBE=180^\circ -B$ and $\angle BCE=A$, then $\angle E=\angle B-\angle A$. Since we have an isosceles triangle $JEK$ (because we have shown earlier that $EJ=EK$), then the base angles must be equal to: 
$$\angle KJE=\angle JKE=\frac{180^\circ-(B-A)}2 \tag6$$
Following the same reasoning, we can show that $\angle FDC=\angle B$ and $DCF=\angle A$ and $\angle F=180^\circ-(A+B)$ and since $\triangle FIL$ is isosceles, thus the base angles are:
$$\angle FIL=\angle ILF=\frac{B+A}2\tag7$$
Finally, look at the quadrilateral $KMLC$. Since the original $\angle C=180^\circ -A$, and from the base angles we derived above, we can write the equation to solve for $\angle KML$ as:
$$\angle JKE+\angle ILF+\angle C+\angle KML=360^\circ\\
\frac{180^\circ-(B-A)}2+\frac{B+A}2+180^\circ-A+\angle KML=360^\circ\\
\angle KML=90^\circ\\\tag8
Q.E.D.$$
