开发者

C# Winform XNA Collision

开发者 https://www.devze.com 2023-01-20 06:00 出处:网络
I\'m interested in knowing how I would go about detecting a primitive circle touching another primitive circle?

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

0

精彩评论

暂无评论...
验证码 换一张
取 消