if the points of intersections of two circles are defined(known), how can these points used to decide if a given point p is inside an overlapped area or outside it ? in other words, can we make any relation between the intersection points and the points inside or outside the intersection area?
-
I'm supposing you know also the circles. Isn't it? – sinbadh Jan 27 '16 at 02:36
-
yes , the circles are known and have equal radius – user308341 Jan 27 '16 at 02:40
2 Answers
If you don't know anything more about the circles, then no, there is no way to tell whether a third point is within the overlap or not.
Given three points, I think you can draw a pair of circles meeting in just those two points such that the overlap contains the third, an another pair meeting in just those two points such that the overlap does not contain the third.
I suppose if the three points are collinear, you may have to allow the circles to coincide to have the third point lie in the overlap, in which case the circles meet at more than just two points.
Also, we should probably speak of "disks" as far as the overlap goes. "Circles" are boundaries of "disks", and we may need to specify "closed disks" for the degenerate cases.
- 43,638
-
Thank you very much. I am looking for a simple solution with low computational cost. – user308341 Jan 27 '16 at 08:06
Since you know the both centers and both radios, say $r$, you can apply a traslation and a rotation to the plane to have one of the points of intersection at $(0,0)$ and the other at $(0,a)$, with $a>0$.
So, let us assume that one point is $(0,0)$ and the other is $(0,a)$. Then, the centers are in $O_+=(\sqrt{r^2-\frac{a^2}{4}},a/2)$ and $O_-=(-\sqrt{r^2-\frac{a^2}{4}},a/2)$
Then, a point $(x,y)$ is inside the intersection iff
a) If $x\ge 0$ and his distance to $O_-$ is $<r$. That is, $x\le 0$ and $$\left(x+\sqrt{r^2+\frac{a^2}{4}}\right)^2+\left(y-\frac{a}{2}\right)^2\le r^2$$
or
b) If $x< 0$ and his distance to $O_+$ is $<r$. That is, $x\le 0$ and $$\left(x-\sqrt{r^2+\frac{a^2}{4}}\right)^2+\left(y-\frac{a}{2}\right)^2\le r^2$$
In the same way you can construct the criteria for $(x,y)$ outside the intersection.
PD: I'm considering that both circles contains includes both circunferences. In other case, the argument is the same only changing the signs $\le $ by $<$
- 7,521
-
Is this rotation and translation can be done one time, or every time when i want to check a point i need to do it ? because i am looking for a solution that consume less computational power . Thank you very much. – user308341 Jan 27 '16 at 08:03
-
You calculate first rotation and translation (or translation and rotaion. Is the same). Once you calculated, all the process that i described is the same. It means that if you calculate rotation and translation, then the test is well for all points – sinbadh Jan 27 '16 at 08:09
-
These two operations(rotation and translation)should be done for both circles, isn't it ? – user308341 Jan 27 '16 at 11:37