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 wi开发者_StackOverflowth 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?
You can check if the distance between their center is less or equal to the sum of their radius
精彩评论