The smooth and level parade ground of the First Ruritanian Infantry Divison is ornamented by two tall vertical flagpole of heights $h_1$ and $h_2$ a distance d apart. As part of an initiative test a soldier has to march in a such a way that he keeps the angles of elevation of the tops of the two flagpoles equal to one another. Show that if the two flag poles are of different heights he will march in a circle.
To celebrate the King's birthday a third flagpole is added. Soldiers are then assigned to each of the three different pairs of flagpoles and are told to march in such a way that they always keep the tops of their two assigned flagpoles at equal angles of elevation to one another. Show that, if the three flagpoles have different heights $h_1, h_2$ and $h_3$ and the circles in which the soldiers march have centres at $(x_{ij},y_{ij})$ (for the flagpoles of height $h_i$ and $h_j$) relative to Cartesian coordinates fixed in the parade ground, then $x_{ij}$ satisfy $$h_3^2(h_1^2-h_2^2)x_{12}+h_1^2(h_2^2-h_3^2)x_{23}+h_2^2(h_3^2-h_1^2)x_{31}=0.$$ Deduce that the three centres lie in a straight line.
The question is much shorter than it looks. The first part is easy, by drawing a quick diagram you get that, with coordinates relative to one of the flagpoles and both of flags on the $y$-axis, $$(h_1^2-h_2^2)x^2+(h_1^2-h_2^2)y^2-2h_1^2dx+h_1^2d^2=0$$ as the locus of the soldiers. For the second part I'm pretty sure you just have to use this equation three times. Completing the square gives the centre of the circle having coordinates $\left(\frac{dh_1^2}{h_1^2-h_2^2},0\right)$ i.e. a distance $\frac{d_{12}h_1^2}{h_1^2-h_2^2}$ along the line connecting pole 1 and 2 where $d_{12}$ is the distance between them(and analogous equations can be written down the other pairs of poles). However, this isn't really $x_{12}$ due to our choice of axes, we can only say, in terms of vectors $$(x_{12},y_{12})=X_1+\frac{dh_1^2}{h_1^2-h_2^2}{(X_2-X_1)}$$ where $X_1$ is the absolute position vector of the first flag pole, $X_2$ of the second. Writing down the equations of this form for the other circles gives a nasty system of vector equations, which you could probably solve to eliminate $X_1,X_2,X_3$, but have no hope of getting rid of $d_{12}$ et al. and is no way the question is supposed to be approached. There is a "model" answer here if this has some more details that may be useful to you, but it is totally unintelligible to me.
I would like to know how to proceed in generalising the first result as is required, to get the required answer. The question is question 7 here should it be needed.
EDIT: I have solved the question in the manner set out above(thanks to a comment below), I will let the bounty go to the most upvoted answer(of which all so far have been wonderful) in a couple of days


Let us try to understand this using the answer you have mentioned.
First of all, you seems to have solved the first part and have got the right answer. As mentioned in your solution, let $X_1, X_2, X_3$ be the position vectors of the flag poles and $h_1, h_2, h_3$ be their respective heights.
According to your solution, if $X_1 = (0,0)$ and $X_2 = (d,0)$ then the position vector of the centre of the corresponding circle formed is $v_{12} = \left( \frac{d {h_1}^2}{{h_1}^2 - {h_2}^2}, 0 \right)$. Thus, the ratio between the distance of $X_1$ and $v_{12}$, and the distance between $X_2$ and $v_{12}$ is $$\frac{{h_1}^2}{{h_1}^2 - {h_2}^2} : \frac{-{h_2}^2}{{h_1}^2 - {h_2}^2}$$ This can be calculated by taking the difference of corresponding position vectors and taking the ratio of coordinates. Note that the ratio does not depend on $d$, as you seems to have indicated in your calculaton of $(x_{12},y_{12})$. The negative sign in the ratio just indicates that the point $v_{ij}$ is not BETWEEN the points $X_i$ and $X_j$, but still on the line joining them. Especially, this does not make our calculations wrong.
The observation about the ratio can be extended to the other two pairs also, by changing the variables appropriately. Denoting the (position vector of the) centre of circle corresponding to $X_i$ and $X_j$ by $v_{ij}$, we get that the corresponding ratio between distances to the $v_{ij}$ is $$m_1 : m_2 = \frac{{h_i}^2}{{h_i}^2 - {h_j}^2} : \frac{-{h_j}^2}{{h_i}^2 - {h_j}^2}$$
By section formula,
$$\begin{equation} \begin{aligned} v_{ij} &= \frac{m_1 X_2 + m_2 X_1}{m_1 + m_2} \\ &= \frac{{h_i}^2 X_j - {h_j}^2 X_i }{{h_i}^2 - {h_j}^2} \end{aligned} \end{equation}$$
Thus, $${h_k}^2 ({h_i}^2 - {h_j}^2) v_{ij} = {h_k}^2 {h_i}^2 X_j - {h_k}^2 {h_j}^2 X_i$$ Summing over the appropriate indices $i,j$ and $k$, we get that the right hand terms all get cancelled. $$h_3^2(h_1^2-h_2^2)v_{12}+h_1^2(h_2^2-h_3^2)v_{23}+h_2^2(h_3^2-h_1^2)v_{31}=0$$ The required equation is the $X$-coordinate of LHS. Similarly, using Y-coordinates instead, we get the corresponding equation in $Y$- coordinates.
Now to note that the three centres lie on a straight line, note that $ v_{12}$ is the point that divides the line joining $v_{23}$ and $v_{13}$ in the ratio $${h_1}^2 ({h_2}^2 - {h_3}^2) :{h_2}^2 ({h_3}^2 - {h_1}^2)$$ using the equation(s) that we just obtained. This means that the three centres lie on a straight line.