Link to home
Start Free TrialLog in
Avatar of ukerandi
ukerandiFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Algorithm

Any one can guide me how to do that?
Design a Circle class and write a function to determine if 2 circles intersect
Avatar of jmcg
jmcg
Flag of United States of America image

Your circle class should contain methods or members that determine the x-y location of the centers and the radii. Two circles intersect if the distance between their centers is smaller than or equal to the sum of their radii but also larger than or equal to the smaller circle's radius.
ASKER CERTIFIED SOLUTION
Avatar of Dmitry G
Dmitry G
Flag of New Zealand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Good, Anarki, it's harder than I thought. Should have googled for an answer instead of thinking I knew it.
In most tasks, I think, the first condition you gave  is 100% correct.
So your answer is good!
> Should have googled for an answer instead of thinking I knew it.

No. Then you hadn't learned anything. You did it right.

/gustav