[Community Puzzle] Disks intersection

Coding Games and Programming Challenges to Code Better

Send your feedback or ask for help here!

Concerning the community puzzle “Disks intersection”: My problem is that the validator (which ofc. differs from test case) for “Same Radius” fails on my solution. No I didn’t hardcode it. It passes all other test cases and validators.

My solution is based on the formula easily found on the web, I use python3 and the default math package. I tried two different approaches to see if some subtractions lead to rounding errors. I tried handling the special case when the radi are exactly equal. I tried to handformat the output value. No luck.
What is the problem with this validator?

Beware, you can’t use the formula without using your brain for some test cases.

Ok I got it, I was on the wrong track because of the validator’s name and searched for errors in the formula.
I already handled the special cases separately but got the radi switched up at one point. Thanks

I use this code, passed all the test but failed at validator 1 and 2, which is the answer is 0.00. Can I ask why I am wrong at those tests?
console.log(intersect(d1,d2)==0?"0.00":intersect(d1,d2));

You may send me your code in private message and I’ll take a look.

These three custom cases may help those players who fail Validators 1 or 2:

87 83 72
-87 -36 19

92 78 3
21 71 19

-7 8 3
-7 1 3

The answers should all be 0.00.