mercredi 6 mars 2019

Finding movement reflection inside a circle

I have a red dot that I put randomly inside a circle (ie. dot.x = -80, dot.y = -10). Coordinate system is based on the center of the circle (0,0). The circle has a random radius (ie. 100)

I give the dot some random movement speed (ie. xspeed = 1, yspeed = 2).

How do I find out the reflection vector (xspeed & yspeed) AFTER the dot hits the circle?

Click here for drawing





Aucun commentaire:

Enregistrer un commentaire