Imagine we are given three intersecting circles centered on the vertices of an equilateral triangle of side length $1$, with $(0,0)$ arbitrarily placed at the bottom left corner. The circles have radii $r$, $r+a$, and $r+b$ respectively (going clockwise again arbitrarily), where $r$ is unknown but $a$ and $b$ are given. For sake of ease we can assume $0
I apologize for the crude nature of the diagram, but it was the best I could come up with using MS Paint. Additionally, I'm 99.9% there's a unique solution as long as we restrict our solution set to points inside the triangle, but this may not be the case. Thank you so much for any help. Edit: if anybody has any bright ideas in this direction, the solution doesn't need to be exact; a close approximation with nicer algebra would be much appreciated.
Intersection of 3 circles on equilateral triangle given the difference in their radii
-
1Consider using barycentric coordinates on a triangle. – 2017-01-19
-
0If you’re *assuming* that the intersection exists, why can’t you simply compute the intersection of two of the circles? At most one of the intersection points will be within the triangle. – 2017-01-19
-
0@amd wouldn't there be an infinite set of intersections both inside and outside the triangle, as r is unknown? – 2017-01-19
-
0Oops. Never mind—I forgot that $r$ was unknown. – 2017-01-19
4 Answers
First, note that (x,y) is determined by the intersection of the circles with radii r and r+b, Given the "safe" values assumed, so we should be able to express both x and y in terms of r and b only.
Safe values values are those such that:
* 2r + a > 1
* 2r + b > 1
* r + a < 1
* r + b < 1
Since it was specified that a < b, this list can be shorted to:
* 2r + a > 1 (so that each circle intersects the other 2 circles)
* r + b < 1 (so even the largest circle has points in the triangle)
First, we find x in terms of r and b, from the equations for those circles.
Define the coordinates of the vertices as (0,0), $\left(\frac12,\frac{\sqrt3}2\right)$, (1,0) for the circles with radiui r, r+a, and r+b respectively.
These give the equations:
$$\eqalign{
x^2+y^2=r^2&\qquad\qquad(1)\cr
(x-1)^2+y^2=(r+b)^2&\qquad\qquad(2)\cr
(x-\tfrac12)^2+(y-\tfrac{\sqrt3}2)^2=(r+a)^2&\qquad\qquad(3)\cr}$$
We will use equations (1) and (2) to find x in terms of r and x.
Expanding (2) we get:
$$x^2 -2x + 1 + y^2 = r^2 + 2rb + b^2$$
Subtracting Equation (1) from this gives:
$$1 - 2x = 2rb +b^2$$
Solving for x we obtain:
$$ x = {1-b^2 \over 2} - rb$$
Substituting this for x gives:
$$
\begin{align}
y^2 & = r^2 - x^2 \\
& = r^2 - \left({1-b^2 \over 2} - rb \right)^2\\
& = {(1-b^2)^2 \over 4} - (1 - b^2)rb +r^2b^2 + r^2 \\
& = {(1-b^2)^2 \over 4} - (1 - b^2)rb +r^2(1 + b^2) \\
& = {(1-b^2)^2 \over 4} + r(b^3 +b) + r^2(1 +b^2) \\
& = {(1-b^2)^2 + 4r(b^3 +b) + 4r^2(1 +b^2) \over 4} \\
y & = {\sqrt{(1-b^2)^2 + 4r(b^3 +b) + 4r^2(1 +b^2) } \over 2} \\
\end{align}
$$
So $(x, y) = \left( {1-b^2 \over 2} - rb , {\sqrt{(1-b^2)^2 + 4r(b^3 +b) + 4r^2(1 +b^2) } \over 2}\right)$.
Done.
Remarks.
First, we know that since r and b are > 0, the last expression for $y^2$ is positive, so the square root gives a real number for y.
Second, we asserted at the beginning that the point (x,y) is determined only by r and b. We prove this by showing (x,y) in terms of only r and b, making no use of a. This also implies that a is determined by r and b.
By substituting the expressions for x and y in terms of r and b into Equation (3) then solving for a, an expression for a in terms of r and b can be found.
This can be done, but unless someone has a bright idea, the algebra is pretty revolting. Start with $$\eqalign{ x^2+y^2=r^2&\qquad\qquad(1)\cr (x-1)^2+y^2=(r+b)^2&\qquad\qquad(2)\cr (x-\tfrac12)^2+(y-\tfrac{\sqrt3}2)^2=(r+a)^2&\qquad\qquad(3)\cr}$$ If you now take $(a-b)$ times $(1)$, minus $a$ times $(2)$, plus $b$ times $(3)$, then assuming my algebra is correct you get $$(2a-b)x-b\sqrt3\,y=(a-b)(ab+1)\ .$$ Now solve for $y$ in terms of $x$; use $(1)$ to get $r$ in terms of $x$; then use these and $(2)$ to get an equation in $x,a,b$ only. If, again, my algebra is correct (highly unlikely), you end up with the quadratic $$(12-12b^2-16a^2+16ab-4b^2)x^2+(-12+12b^2+8(2a-b)(a-b)(ab+1))x+(3+3b^4-6b^2-4(a-b)^2(ab+1)^2)=0\ ,$$ which hopefully will turn out to have real solutions.
Sorry for the cop-out but I am definitely leaving the rest to you :)
-
0This looks nice. As I said in the below comment, I've gone down the "revolting algebra" road, and I was hoping somebody would post an answer that was slightly more elegant. If I don't get an answer along those lines, I'll be sure to mark this correct, after I verify the algebra :) . – 2017-01-19
-
1I think the algebra can be made less revolting by using polar coordinates. At least that's what I attempted in my answer. – 2017-01-19
Consider a general point $(x,y)$ inside the triangle, and let the distance of $(x,y)$ from the vertices $(0,0),$ $\left(\frac12,\frac{\sqrt3}2\right),$ and $(1,0)$ be $r_1$, $r_2,$ and $r_3$ respectively. (That is, each of $r_1$, $r_2,$ and $r_3$ is a function of $(x,y)$.)
We want to find a point $(x,y)$ such that $r_1 = r$, $r_2 = r+a,$ and $r_3 = r+b,$ if such a point exists, where $r,$ $a,$ and $b$ are given.
Among other things, $(x,y)$ must satisfy the condition $r_3 - r_1 = b.$ This condition defines one branch of a hyperbola with foci at $(0,0)$ and $(1,0)$, semi-major axis $\frac b2,$ and eccentricity $\frac 1b.$ In polar coordinates $(\rho,\theta)$, the equation of this hyperbola is $$ \rho = \frac{\frac b2\left(\left(\frac 1b\right)^2 - 1\right)} {1+\frac 1b\cos\theta} = \frac{1 - b^2}{2(b + \cos\theta)} $$
But $(x,y)$ must also satisfy $r_2 - r_1 = a,$ which puts it on a hyperbola with foci at $(0,0)$ and $\left(\frac12,\frac{\sqrt3}2\right),$ whose equation is $$ \rho = \frac{1 - a^2}{2\left(a + \cos\left(\theta - \frac\pi3\right)\right)} $$
Since the desired point $(x,y)$ must satisfy $r_3 - r_1 = b$ and $r_2 - r_1 = a$ simultaneously, we have $$ \frac{1 - b^2}{2(b + \cos\theta)} = \frac{1 - a^2}{2\left(a + \cos\left(\theta - \frac\pi3\right)\right)}. $$
Cross-multiply, use the fact that $\cos\left(\theta-\frac\pi3\right) = \frac{\sqrt3}2 \sin\theta + \frac12 \cos\theta,$ and collect everything except the $\sin\theta$ terms together, and we have $$ \frac{\sqrt3}2(1 - b^2)\sin\theta = \left(\frac12 - a^2 + b^2\right) \cos\theta + b(1 - a^2) - a(1 - b^2).\tag1 $$
Let $u=\cos\theta$ (so that $\sin^2\theta = 1-u^2$); let $n=\frac34(1-b^2)^2,$ $m=\frac12 - a^2 + b^2,$ and $k=b(1 - a^2) - a(1 - b^2)$; rewrite Equation $1$ in those terms; and square both sides. The result is $$ n(1-u^2) = (mu +k)^2, $$ which is equivalent to $$ (m^2 + n)u^2 + 2mku + k^2 - n = 0. $$ Solving for $u$ via the quadratic formula, \begin{align} u &= \frac{-2mk \pm \sqrt{4m^2k^2 - 4(m^2k^2+k^2n-m^2n-n^2)}}{2(m^2+n)} \\ &= \frac{-mk \pm \sqrt{m^2n+n^2-k^2n}}{m^2+n} \\ \end{align}
The conditions of the problem require $0\leq\theta\leq\frac\pi3$, therefore $\cos\theta \geq \frac12.$ Moreover, $m>0$ and $k>0.$ It follows that only the $+$ case of the $\pm$ sign can possibly lead to a solution to the original problem. Wolfram Alpha indicates that $m^2n+n^2-k^2n$ is positive when $0 < a < b < 1$, so we don't need to check the sign before taking the square root.
So to find $(x,y)$ given $a$ and $b,$ we set $n,$ $m,$ and $k$ as described above, then compute the following quantities in the sequence shown: \begin{align} u &= \frac{-mk + \sqrt{m^2n+n^2-k^2n}}{m^2+n}, \\ \rho &= \frac{1 - b^2}{2(b + u)}, \\ x &= \rho u, \\ y &= \rho \sqrt{1 - u^2}. \end{align}
Done!
-
0This is wonderful, except for one thing: in my particular application, a and b aren't known in advance of setting up the calculation. In other terms, I need (x,y) in terms of a and b, such that I could plug in any A's or B's and get an immediate answer. Unfortunately, after attempting to solve for theta using Wolfram Alpha we are left with an utter monstrosity, no better than the revolting algebra other answers have posted. Maybe you have an idea around this? Thanks so much, I appreciate your help tremendously. – 2017-01-19
-
0It looks tedious but relatively straightforward to me. You don't have to actually write out some huge formula the way WA does; you can do it step by step. It may be even easier than I thought, now that I noticed the quadratic equation in $\cos\theta$. – 2017-01-19
-
0With appropriate application of the quadratic formula, it's even simpler than I thought. I've edited out the ugly stuff. – 2017-01-19
-
0This is beautiful, except for one weird issue. I've implemented your solution and tested it experimentally (as it's easy to generate points inside the triangle and get testing data). Oddly enough, I seem to have a persistent error of around ~ 0.033. The generated Y coordinates from your solution are always slightly too large, while the generated X coordinates are always slightly too small. I've double and triple checked my code: I implement your method exactly, with no room for floating-point related errors. This seems quite odd to me, as we're _so_ close; it's just a teensy bit of error left. – 2017-01-20
-
0@Josh This sort of discrepancy makes me suspect an error in the derivation of the formulas, perhaps taking $-(-z)$ as $-z$ or some other mistake like that. I expect to have some time to check the math more carefully next week (maybe even try my own implementation) if you don't found the error first. – 2017-01-20
Let the coordinates of the triangle be $(0,0),(1,0),\left(\frac{1}{2},\frac{\sqrt{3}}{2}\right)$. Then, we can write three equations of the form
$$(x-x_0)^2+(y-y_0)^2=r_0^2$$
for various $x_0,y_0,r_0$. What happens if you assume a solution to each of these concurrently and then solve for $r$?
-
0I tried working it out that way, but it was super ugly and I ran into a couple tricky points. Essentially, we end up with three equations but two unknowns. We might think we could discard the first equation (r=sqrt(x^2+y^2)), but we end up missing a lot of information, such as where perpendicular the top-right line of the triangle the point lies. Furthermore, this answer doesn't limit the solution to points inside the triangle, which is problematic as we can have multiple (maybe infinite) solutions. I was hoping that there was a very pretty linear algebra solution, rather than ugly algebra. – 2017-01-19
