RoR
RoR

Reputation: 16482

C# Winform XNA Collision

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?

Upvotes: 0

Views: 239

Answers (1)

Johann Blais
Johann Blais

Reputation: 9469

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

Upvotes: 2

Related Questions