A simple C++ physics simulation for calculating rocket trajectories using projectile motion equations.
- Interactive velocity and angle input
- Real-time trajectory calculation
- Outputs position data at each time step
- Calculates final landing position
Uses basic projectile motion equations:
- Horizontal:
x = v₀ cos(θ) × t - Vertical:
y = v₀ sin(θ) × t - ½gt²
g++ -o rocket main.cpp -lm./rocketEnter your desired launch velocity (m/s) and angle (degrees) when prompted.
Enter launch velocity (m/s): 50
Enter launch angle (degrees): 45
Time X Y
--------------------
0.00 0.00 0.00
0.10 3.54 3.44
...
Rocket landed at X = 255.10 meters
Arjun Myanger - GitHub
MIT License