Calculate angle change after hitting a tilted wall
问题 I'm making a game in javascript, where an object is supposed to bounce from walls. I really tried to get it to work myself, but it never works correctly. Let's say theres a ball bouncing inside this cage (blue = 30°, brown = 60°); The ball's coordinates are known. The angle of movement is known. The point of collision (P) coordinates are known. The angle of the wall is known. The ball's position is updating it's coordinates inside a setInterval function using this function: function