How to find the coordinates of a point at the end of a chord on a circle?

79 Views Asked by At

I'm working on a game but have never taken linear algebra and am not sure what math functions I should be using to get the desired result.

In this scenario, a player is shooting a zombie represented by a circle. How do I calculate the x/y coordinates of the exit wound?

enter image description here

Things that are known:

  • The x/y coordinates of the bullet upon collision
  • The x/y coordinates of the center of the zombie's circle
  • The radius of the zombie's circle

Things that I want to know:

  • The x/y coordinates of the entry wound

Bonus points:

  • How do I calculate the rotation for the exit wound?

I was thinking of somehow calculating the tangent line of the impact point and using that to calculate the final coordinates, but I'm not sure if that is even the right approach.

In the image below, a is the point-of-impact and b is the exit wound:

enter image description here