Console-based physics experiments implementing numerical integration, terminal motion, and restitution dynamics in C++.
- Free Fall (
free_fall.cpp): Simulates gravitational acceleration and terminal landing from a specified height. - Bouncing Ball (
bouncing_ball.cpp): Introduces a coefficient of restitution (elastic collision) and an energy decay threshold to simulate realistic bouncing until rest.
- Euler Integration: Discrete time steps (
deltaTime) updating velocity and position vectors. - Collision & Restitution: Inverts and scales velocity on impact to model kinetic energy loss.
- Encapsulated Results: Uses
SimulationResultstructs for clean data passing.
# Compile Free Fall simulation
g++ -std=c++17 free_fall.cpp -o free_fall.exe
./free_fall.exe
# Compile Bouncing simulation
g++ -std=c++17 bouncing_ball.cpp -o bouncing_ball.exe
./bouncing_ball.exe