ScratchData LogoScratchData
Back to SohCahToa314's profile

Newtons Cradle

SOSohCahToa314•Created May 21, 2013
Newtons Cradle
1856
1496
50462 views
View on Scratch

Instructions

Hit the Pause button to move the balls. Click on a ball and move using the mouse. Click again to stop moving it. Press Play to start again. By request, you can now also move the balls with the arrow keys. You can cut and reattach the balls by hitting the numbers 1 to 5 Noticed that there is sometimes a bit of a speed problem with the sound on.

Description

First wrote something like this over 35 years ago on a 286 machine. Thank you for all your great comments. Many have asked how I did this. To answer the question a bit: Each Ball has an Angle and a Velocity (or energy level). When the angle of a ball becomes greater than the angle of it's neighbour then, in real life, it would have hit the neighbour and would exchange velocities. So I swap the values and, to keep the positions correct, swap the angles. Each time round the loop, it looses a little of the velocity to account for loss of energy. The velocity is also continually being adjusted to account for gravity.

Project Details

Project ID10354959
CreatedMay 21, 2013
Last ModifiedAugust 3, 2021
SharedMay 22, 2013
Visibilityvisible
CommentsAllowed