Can someone quickly explain two circle shapes colliding?

I need to know how to calculate the collision of two circular shapes for a project due in two days.  I have the whole program working (even a computer opponent) and obviously whats missing is the collisions.  I have the code if you need it.  Thanks
Who is Participating?
amebaConnect With a Mentor Commented:
If C1 (x1,y1) is center of the first circle, and C2 (x2,y2) of the second, calculate distance d from C1 to C2.
   d = sqr((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1))
Collision is if:
   d < r1+r2
where r1 and r2 are radiuses of the circles.
edone73Author Commented:
Hey Ameba, thanks for your answer.  But how bout the angles?  Please help me out.  I really need it.
edone73Author Commented:
I need to know how to calculate the angles once i calculate the distance (angles of deflection).
Thanks for B.
Sorry, cannot help with angles now.
edone73Author Commented:
Why Not?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.