Rotation of 3 circles in square I'm doing a rotation animation of 3 overlapping circles and I have to find the number of pixels I need to move all 3 circles on the X-axis so that they are moving symmetrically. In the image below you can see the triangle with its altitudes (green lines). I want to shift all circles by the distance between the middle of the grid and the intersection of altitudes known as the orthocenter of this triangle.
Given a grid 8x8 of height and width equal to a pixels find the distance between the orthocenter of the triangle made by the intersections of the circle (as shown in the picture) and the centre of the grid. Each square edge in the grid is equal to a/8 and the radius of every circle is equal to a/4. The distance that I'm looking for was marked as x

P.S. This is my first post here. Please let me know if everything is clear
 A: Let's work in units of $a/8$. Then the centers of the three circles are at $(1,0)$, $(-1,1)$, $(-1,-1)$. Let's call the vertices of the orange triangle $A, B, C$, with $BC$ the vertical line. Due to symmetry, the triangle is isosceles, $AB=AC$, but not equilateral, since the distance between the centers of the circles is not the same. The position of $A$ is at $y=0$, two units away from $(-1,1)$:
$$(x_A+1)^2+1^2=2^2\\x_A=\sqrt 3 -1$$
For points $B,C$ you need to use that the distance to both centers is the same:
$$(x_B-1)^2+y_B^2=2^2\\(x_B+1)^2+(y_B+1)^2=2^2$$
Subtracting the first of these equations from the second, you get $$4x_B+2y_B+1=0$$
Move $y_B$ term to one side, square everything, and get $y_B^2$ from the first equation:$$(4x_B+1)^2=4(3-x_B^2+2x_B)$$
This is a simple quadratic, and we want the negative $x_B$ solution. If I did not make any mistake, then $$x_B=x_C=-\sqrt{\frac{11}{20}}$$
After this, you calculate $y_B$ and $y_C$. The formula gets a little more complicated, but you can reduce it to $$y_B=-y_C=\sqrt{\frac{11}5}-\frac12$$
So now you have all the vertices of the orange triangle. Calculate the slope $m$ of $AC$. Then the slope of the perpendicular is $-\frac1m$. Now write te equation of the line with this slope, going through $B$, and find the intersection with $y=0$. That's the point you are looking for.
A: 
The triangle $ABC$ is isosceles with base $AC$. By construction, the angles $\angle{KCH}$ and $\angle{CBH}$ are congruent, since they are complementary to the two base angles. Therefore, the triangles $\triangle{KCH}$ and $\triangle{CBH}$ are similar, and we have the proportion $KH:CH=CH=BH$.
Now, by simplicity, let us rename the base and the height of the initial triangle as $\overline{AC}=b$ and $\overline{BH}=h$. Also, let us set $\overline{OH}=k$ and $\overline{OK}=x$ (this last segment is what the OP is asking for). Using the proportion above, we get
$$\overline{KH}=\frac{b^2}{4h}$$
and then
$$x=k-\frac{b^2}{4h}$$
The coordinates of the vertices $A,B,C$ can be easily obtained by considering the equations of the three circles and have already been reported in another answer. From this, we have
$$k=\frac{1}{2}\sqrt{\frac{11}{5}}$$
$$b=1-2\sqrt{\frac{11}{5}}$$
$$h=\frac{1}{2}\sqrt{\frac{11}{5}}+\sqrt{3}-1$$
Substituting in the equation above (again by simplicity I omit the calculations and simplifications, but you can check the result here), we get a rather complicated fraction with various radicals that can be written in several ways.  Probably the most compact form is
$$x=\frac{\sqrt{55} + \sqrt{165}-19}{ \sqrt{55}+ 10 \sqrt{3} -10}\\ \approx 0.08559789...$$
or alternatively
$$x=\frac{\sqrt{11/5} + \sqrt{33/5}-19/5}{  \sqrt{11/5}+ 2 \sqrt{3} -2}$$
which gives the same numerical value. It is straightforward to express this result in terms of $a$, by taking into account that each square edge in the grid is equal to $a/8$.

Just for a rapid numerical check, approximated to 4 decimal digits, using a different method: the slope of the line $AK$ is given by $h/(b/2)$. Taking $$h= \left(\frac12 \, \sqrt{11/5}+\sqrt{3}−1\right)\approx 1.4737$$ and $$b/2=(1/2−\sqrt{11/5}\approx 0.9832$$ we have that the slope is $$1.4737/0.9832\approx 1.4988$$ The line passes through point $A$, whose $x$-coordinate is $-1/2\sqrt{11/5}\approx-0.7416$ and whose $y$-coordinate is $\approx -0.9832$. The intercept of the line $AK$ is then $$-0.9832+1.4988\cdot 0.7416\approx 0.1283$$
From this, setting $y=0$ in the equation $y=1.4988 x + 0.1283$, we get that the $x$-coordinate of $K$ is $$-0.1283/1.4988\approx -0.0856$$ in good agreement with the exact value calculated above.
A: See post above how to get $x_B, x_C=-\sqrt{\frac{11}{20}}$ and the other coordinates of points of intersection.

$A = (\sqrt3-1, 0)$
$B =(-\sqrt{\frac{11}{20}}, -(\sqrt{\frac{11}{5}}-\frac{1}{2}))$
$C =(-\sqrt{\frac{11}{20}}, \sqrt{\frac{11}{5}}-\frac{1}{2})$
Since $CG$ is normal to $AB$, its slope $mx =\frac{x_A-x_B}{y_A-y_B}x$.
Equating this slope for $C =(-\sqrt{\frac{11}{20}}, \sqrt{\frac{11}{5}}-\frac{1}{2})$ gives you the shift constant $b$ in $DG = mx+b$ which then allows $mx+b$ to be solved for $y=0$. This yields
$G \approx (-0.0855978953, 0)$
So, with $1=\frac{a}{8}$, your shift of $\frac{-x_g}{8}$ in terms of $a$ is then
$x \approx$ $0,0107 \cdot a$.
The distance that I'm looking for was marked as x

