enter image description hereI used a vector to determine the collision between a line and a circle. Here's the way I thought of it in the beginning.

1. When the ball collides with a straight line, it finds a normal line passing through the center point.

2. Take the coordinates before the ball collides and move symmetrically with respect to the normal.

The results were similar to those intended, but unstable. Since then, I have tried to find the angle using the vector, but it has not progressed since then. enter image description here


1 Answer 1


Find the intersection point between the parallel to the line at distance R and the trajectory of the center of the ball.

Now notice that the sum of the incoming and outgoing direction vectors (let I and O) is parallel to the line, corresponding to a vector α.D of unknown length.

I + O = α.D

The by expressing that I and O have the same length,

(α.D - I)² = I²


α.D² = 2 D.I

which gives α and O = 2 (D.I/D²).D - I.

  • $\begingroup$ If D is a unit vector, I understand. $\endgroup$
    – GT K
    Commented Oct 19, 2022 at 1:25
  • $\begingroup$ If so, will it be solved if i find the unit vector of the straight line? $\endgroup$
    – GT K
    Commented Oct 19, 2022 at 2:14
  • $\begingroup$ @GTK: D does not need to be unit. The O solution is a vector of the same length as I. $\endgroup$
    – user16034
    Commented Oct 19, 2022 at 6:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.