The question is: Given the coordinates and radius of 2 circles, how could we figure out the 2 intersection points of them?
Sure, it could be easily done by using the formula of root. And there are many other methods also. None of them is hard to figure out. (Although the formula of root requires great patience to verify the super long formula sentences.)
I have been engaged with this problem in my research recently. At first, I applied the formula of root thing. And I got some error because the inaccuracy of the outcome intersections. I thought it could be: 1st, the algorithm, since I noticed that some intermediate variable got astronomical large during the compuation. 2nd, the inaccuracy of the essence of float number. Since float number is always an approximation of real number.
Base on my first thought, I did the following changes:
1) Apply another method. I implemented another algorithm which I thought would be better. (Actually, I don't know the exact answer so there is no way I can tell an outcome is good or not.) I did get different answer to the 1st algorithm, but the difference is trival, if not neglectable. The results only differ in 10^-13, which I believe is not significant to this problem I am dealing with. So, that's not about the algorithm. (But the 2nd one is faster really.)
2) Using the data type "Decimal" in VB.NET, which provides more accuracy. When comparing to the data type "Single", the results differs in 10^-7. It could be the case, so let me double check here:
Reformulated problem: We randomly pick 1000 real numbers from (0,1). If the differenceany pair of the numbers is less than 10^7, error will occur. So the question is, what's the error probability?
Apparently, the Pr for the 1st number DOES NOT violate the restrication is
(1-10^-7)^999 ~= 0.99990010498490 (Got it from matlab, no time for fancy Pr computing. ^_^)
To make it easier, suppose each one has the same Pr. So the Pr of all 1000 numbers are correct is:
0.99990010498490 ^1000 = 0.90492790183237
We thus know the error Pr is around 10%. Hooray! That's pretty high. It could be the reason after all. So how about the error Pr of Decimal? It would be some where around 10*-9. We will change them all to Decimal and see what we can get.