From: Frank N. <fra...@sb...> - 2005-05-29 16:54:07
|
Hello everyone, My students are enjoying using VPython and are learning quickly. My first assignment is to have students modify the bounce.py program in a variety of ways. I'd like for them to add a coefficient of restitution to more closely simulate the bouncing of a real ball. My thinking is to modify the ball/floor impact detection statement to read: if (ball.pos.y <= ball.radius): ball.velocity.y = -c*ball.velocity.y where "c" is the coefficient of restitution. Using a drop height of 20, an initial velocity of 0, and c = 0.85, the ball only bounces once and then sticks to the floor :( Changing only the drop height to 10, the ball now bounces 7 times before sticking to the floor. :| Shouldn't the ball bounce forever (just to a smaller height on each successive bounce)? And why does changing the drop height matter? What's going on? Thanks, Frank Noschese John Jay High School Cross River, NY |