I'm trying to figure out the JavaScript math to move two colliding circles apart from each other.
The left side of this image is a visual representation of what I already have:
x1, y1, x2 and y2 are the positions of the circles, r1 and r2 are the radii of the circles, theta is the angle between the circles in relation to the x-axis of the canvas.
How do I calculate the new [x,y] positions for both circles, so that they "push" each other apart as demonstrated on the right side of the image?
I'm also planning to make the smaller circle be pushed more than the larger one. That should be easy enough by using their normalized radii as a multiplier.