Back to Physics in Simulations
IntermediateTeenagers

Newton's Laws of Motion

Sir Isaac Newton came up with three laws that are the foundation of classical mechanics. They are essential for creating realistic physics in games and simulations.

1. **First Law (Inertia):** An object will stay still, or keep moving at a constant speed in a straight line, unless a force acts on it. (An object in motion stays in motion).

2. **Second Law (F=ma):** The force acting on an object is equal to the mass of that object times its acceleration (Force = mass × acceleration). This is the most important law for simulations. It tells you how much an object's velocity changes when you apply a force like gravity or a push.

3. **Third Law (Action-Reaction):** For every action, there is an equal and opposite reaction. When you push on a wall, the wall pushes back on you with the same force. When a rocket pushes gas out, the gas pushes the rocket forward.

Simple Function

Complete the function to take two numbers and return their sum.