tags:

views:

28

answers:

1

I'm interested in knowing how I would go about detecting a primitive circle touching another primitive circle?

So, if I had a circle with 5,10 and another one with 5,13 with each of them having a radius of 2. well the distance formula is the Pythagorean theorem. which is sqrt((x2-x1)^2 + (y2-y1)^2) = distance and if this distance is less than or equal to the sum of their radius. the sum of the radius is 4? since each circle has a radi of 2? Is this kinda waht you mean?

+2  A: 

You can check if the distance between their center is less or equal to the sum of their radius

Johann Blais
So, if I had a circle with 5,10 and another one with 5,13 with each of them having a radius of 2.well the distance formula is the Pythagorean theorem. which is sqrt((x2-x1)^2 + (y2-y1)^2) = distance and if this distance is less than or equal to the sum of their radius. the sum of the radius is 4? since each circle has a radi of 2? Is this kinda waht you mean?
RoR
I guess that is what he means, and it should wotk just fine. Good answer!
Øyvind Bråthen
Thank you for the confirmation.
RoR
That's exactly what I meant. Thanks Øyvind Bråthen
Johann Blais