Physics sandbox: Newton's laws you can throw around
A blank chalkboard with a real rigid-body solver behind it. Throw things, stack things, change gravity, and let Newton's laws decide what happens.
F = ma
- F
- net force on the body (N)
- m
- mass of the body (kg)
- a
- acceleration of the body (m/s²)
What you are watching
Four bodies start in mid-air: a rubber ball, a wooden box, a steel ball and a stone triangle. They all fall at once and land. The steel ball, more than ten times heavier than the box, thuds and stays put; the rubber ball keeps bouncing for seconds, because rubber returns most of its impact speed (restitution 0.86) while steel and stone return little.
Nothing is animated. Every step, the Rapier solver moves each body by the forces on it and resolves every contact, so the scene is yours to change.
Why it happens
Newton's second law says acceleration is net force divided by mass. In free fall the only force is the weight mg, so a = g for every body: heavy and light fall together. What differs after landing comes from contact forces, which depend on the materials.
The first law says that with no net force, velocity stays constant. The third says two bodies in contact push on each other equally and oppositely, which is why total momentum survives collisions.
When two materials touch, the engine uses the lower friction and the higher restitution, so ice is slippery on anything and rubber bounces off anything. The world is 2D, so masses are per metre of depth.
Try this
- Set gravity to 0 and throw a body. It moves in a straight line at constant speed until it meets a wall: the first law, with nothing hiding it.
- Set gravity to 1.62 m/s² (the Moon) and throw the rubber ball. The same throw goes about six times higher and farther, since both scale as 1/g.
- Press Space to pause, pick the circle tool, and click to place a steel ball and a rubber ball at the same height. Press Space: they land together, then bounce very differently.
- Switch on Force and drag a body: your hand's force appears next to its weight, and the body accelerates along their sum.
Questions
What are Newton's three laws of motion?
A body keeps its velocity unless a net force acts; net force equals mass times acceleration, F = ma; and two interacting bodies exert equal and opposite forces on each other.
Is this a real physics engine?
Yes. Every body is simulated by Rapier, an open-source rigid-body solver compiled to WebAssembly, stepping 120 times per simulated second with real masses, friction and restitution.
More fundamentals experiments
- ProjectileProjectile motion
- PendulumEnergy exchange
- Double pendulumDeterministic chaos
- Newton's cradleConservation of momentum
- Elastic collisionConservation of momentum
- TowerCentre of mass
- Ramp & frictionFriction
- OrbitInverse-square gravity
- SpringsHooke's law
- Pendulum waveSimple harmonic motion
- RopeTension
- Rope vs rodBending stiffness