Here is an example of how we can model motion using scratch programming. Note how the simplest relationships were used and repeated over small time intervals to track the motion of the falling apple: velocity changed by the rate of the acceleration, and position changed by the rate of velocity. Use the methods from this example to create other accurate models of motion in the physical world. An apple falling at constant velocity is shown for comparison only.
Note: the change in position of an object is equal to the average velocity over a time interval, but in this program, the instantaneous velocity was used instead. The use of the instantaneous velocity was preferred for simplicity in programming, and is acceptable with only a small margin of error because of the short intervals of time. By definition, as the intervals of time approach zero, the average velocity approaches the instantaneous velocity.