# Finding coordinate equations for graphing of problem.

Have a request to help me in draw using desmos the "Treasure hunt problem" (explained in detail with basic approaches here with desired implementation as in basic option given here.

I expect that the best approach is to have two circles tangentially intersecting each other, and their centers representing 'Pine' and 'Oak' trees respectively; while the intersection of two circles being the location of 'gallows'. Also, the each circles' two radius are perpendicular to each other. The other end on the perpendicular radii represents 'Spike1', 'Spike2' respectively.

I request some help in finding the intersection point of two circles that represents the gallows, as the main issue is this configuration is not workable , i.e. the intersection of two circles is meaningless once the relative angle among the pine and oak trees (the two radii) is changed.

The only way is for the two circles to be intersecting still, but be able to to move while intersecting at more than one point possibly, as in the below diagram. Anyway, the approach should ensure the independence of treasure from the position of the gallows, as shown in the first link. also, may be for the above approach using circles, polar coordinates' equations may work to represent using coordinate geometry in desmos.
Would prefer the circle based approach, as above.

An alternate approach as shown in the first link also, is to place the trees on the x-axis, with gallows changing location along the locus of some parametric equation as a function of distance from the trees.

In the first approach, the movement of gallows is not possible, and only a particular configuration can be shown like in the first / second diagrams, while in the second approach (as shown in the third diagram, below) the gallows moves as a function on locus.

The second approach is shown below:

• I don't understand what your question is. Apr 19, 2018 at 14:05
• @JohnGlenn Want to plot graph with independent points' coordinates changing to all possible set of values, in desmos. Not clear, but polar equation would be easy if circle approach is taken. Apr 19, 2018 at 14:44
• By "changing to all set of values" you mean an interactive model of the problem? Apr 19, 2018 at 14:46
• Can you edit the question to show the approach you want? Apr 19, 2018 at 14:52
• I don't really know what desmos does or is, but I have the impression that you are using the graphing features of desmos? Why not use the geometry tool? Apr 19, 2018 at 15:26

## Still not sure what you are after, though, but I have constructed the model using functions in Desmos

So you have circles defined by: \begin{align}\left(x-h_1\right)^2+\left(y-k_1\right)^2=r_1^2\tag{1}\\ \left(x-h_2\right)^2+\left(y-k_2\right)^2=r_2^2\tag{2}\end{align} Where $(1)$'s center is the Oak$(h_1,k_1)$ and $(2)$'s center is the Pine$(h_2,k_2)$.

The location of the Gallows is defined by $(G_x,G_y)$, of course the radii of $(1)$ and $(2)$ are defined by: $$r_1=\sqrt{\left(G_x-h_1\right)^2+\left(G_y-k_1\right)^2}\\r_2=\sqrt{\left(G_x-h_2\right)^2+\left(G_y-k_2\right)^2}\\$$

The lines connecting Oak and Pine to Gallows are defined by: $$y-k_1=\left(M_1\right)\left(x-h_1\right)\\y-k_2=\left(M_2\right)\left(x-h_2\right)\\$$ Where $M_1$ and $M_2$ are the slopes of the respective lines. Of course, to get the $90^\circ$ turn, the perpendicular lines equations will be the same as above except the slopes are the negative reciprocal, thus: \begin{align} y-k_1&=-\left(M_1\right)^{-1}\left(x-h_1\right)\tag{3}\\ y-k_2&=-\left(M_2\right)^{\left(-1\right)}\left(x-h_2\right)\tag{4}\\ \end{align}

To find the Spikes, you just have to find the intersection between $(1)$ & $(3)$, and $(2)$ & $(3)$, thus you get: \begin{align}\text{(1) & (3)}\iff (K_x,K_y)&\Rightarrow K_x=\frac{h_1M_1^2+h_1+\sqrt{M_1^2+1}M_1r_1}{M_1^2+1}\\ &\Rightarrow K_y=\frac{k_1M_1^2+k_1-\sqrt{M_1^2+1}r_1}{M_1^2+1}\\ \text{(2) & (4)}\iff (P_x,P_y)&\Rightarrow P_x=\frac{h_2M_2^2+h_2+\sqrt{M_2^2+1}M_2r_2}{M_2^2+1}\\ &\Rightarrow P_y=\frac{k_2M_2^2+k_2-\sqrt{M_2^2+1}r_2}{M_2^2+1} \end{align}

Thus, simply, the Treasure is the midpoint between $(K_x,K_y)$ and $(P_x,P_y)$, which should be: $$M_{P,K}=\left(\frac{P_x+K_x}{2},\frac{P_y+K_y}{2}\right)$$

If you want the two circles tangent at the Gallows$(G_x,G_y)$, then you have to make the Oak, Pine and Gallows collinear, say by lying in the $x$-axis. You can freely move the Gallows then across the $x$-axis. And as mentioned in the first link, the Treasure is invariant to the location of the Gallows.

• Thanks a lot for the implementation of the first diagram. I am trying to make the implementation of the second diagram, so that the gallows is stationary but the trees can move in y-axis. Apr 19, 2018 at 21:29
• @jiten The one I made in Desmos allows you to move all points, i.e. the Oak, Gallows and Pine Apr 20, 2018 at 1:51
• Please help resolve my doubts in answer: The equation ($1$) & ($3$) would yield Please help resolve my doubts in answer: The equation ($1$) & ($3$) would yield the Spike$1$ (for Pine) coordinates, denoted as $K_x, K_y$. To get $K_y$, need get from ($3$) in terms of $x-h_1\,\, (=-(M_1)(y-k_1))$ to substitute in ($1$), to get the coordinates of Spike$1$ as : $(1+(M_1)^2)(K_y-k_1)^2=r_1^2\implies K_y=k_1+\frac{r_1}{\sqrt{1+(M_1)^2}}$. This expression can be further transformed to:$K_y=\frac{k_1M_1^2+k_1+r_1\sqrt{1+(M_1)^2}}{1+(M_1)^2}$. But, minus sign for term $r_1\sqrt{}$ is not got. Apr 20, 2018 at 5:51
• How to specify that the two circles intersect is not clear. As specifying $abs(r_1-r_2)\le \sqrt{(h_1-h_2)^2 + (k_1-k_2)^2}\le (r_1+r_2)$ is also not helping. I have got a graph, from Wolfram, at : desmos.com/calculator/gu4wjdfm1o that covers all possible cases of intersection of two circles; but the issue is still complex. One issue I feel is that when there are two intersection points, then which one to specify as the 'gallows'. Also, the value $d$ is to be prespecified in a range, which is also not the desired feature. Our graph is much more complex comparatively. Apr 20, 2018 at 8:56
• Request suggestions for why my graph below is not at all like your working graph: desmos.com/calculator/xq4qmiqskt. Have put condition at $19$ to enable the circles to intersect as read at math.stackexchange.com/a/456310/424260. This condition was earlier the one stated in the earlier comment, but did not work; as also for this condition. Also, do not know how to get 'gallows' plotted. Apr 21, 2018 at 3:15

If we put the Oak tree at A, and the Pine tree at B, and your starting point at X.

And we plot it in the complex plane.

Then spike 1 is at $A + i(A-X)$ And spike 2 is at $B - i(A-X)$

Putting the treasure at $\frac {A+B}{2} + \frac {A-B}{2} i$ And clearly the location of the treasure does not depend on $X.$