There is a circle which is MOVING to another STATIC circle. I need to find out what angle of the moving circle will be after this collision. I have intial angle of moving circle, its X and Y coords and X,Y of static circle and radius of both circles. I need the formula to calc the angle.
Asked
Active
Viewed 38 times
0
-
I'm not sure what you mean by "calc the angle" here. I understand you have the following problem: Given the current position of the moving circle and the direction in which it is moving, you want to calculate the position the circle will be in when touching the static circle? – mkluwe Apr 01 '16 at 12:03
-
Can you at least show an attempt to solve the problem? – Alessandro Cuttin Apr 01 '16 at 12:04
-
https://en.wikipedia.org/wiki/Elastic_collision – hansmaad Apr 01 '16 at 12:06
-
@mkluwe I have the angle in degrees and then i calculate new position for the moving ball by this formula: `top: curPosition.top + Math.sin(Math.PI * angle / 180) * (FootBall.BALL_SPEED * progress), left: curPosition.left + Math.cos(Math.PI * angle / 180) * (FootBall.BALL_SPEED * progress)`, so i just need to find out new angle when touching the static circle. – Dmitrii Grigoriev Apr 01 '16 at 12:19