Calculate ball velocities after slope bounce

  • Thread starter Thread starter DrKrunklehorn
  • Start date Start date
  • Tags Tags
    Ball Bounce Slope
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
1 reply · 3K views
DrKrunklehorn
Messages
5
Reaction score
0

Homework Statement



Hello! I'm working on my final project for a programming class. Currently I can successfully
detect 2D collision between a ball, and a line that can rotate in any direction.

However when the ball hits the line I need to change it's velocity so it bounces
in the right direction. I'm not worrying about elasticity or friction or anything, just
post collision direction.

Homework Equations



I know basic Trig is involved and maybe Dot product, but I'm pretty sure we don't need that.

The Attempt at a Solution



I thought if the racket was horizontal, it would be as easy as incident angle = reflection
angle. But as the racket tilts upward I pictured the reflection angle decreases at the same
time.

So I tried taking the racket's rotation relative to the ground and subtract it from the ball's
movement angle. This I thought would be the new angle of reflection.

Sadly it didn't work out. Sometimes the ball sort of bounces in the right direction but it's
really shoddy.

Thanks for the assistance!
 
Physics news on Phys.org
Why not work out the vectors for the case that the racket is at zero degrees then rotate the vectors by the racket angle using either matrix or quaternion methods. You may need to detect if that ball hits the top or the bottom of the racket.