This Python script simulates the trajectory of a projectile in a 2D space using Euler's method. The simulation takes into account the initial position, velocity, launch angle, and gravitational acceleration.
-
Projectile Motion Simulation: The script uses Euler's method to simulate the projectile's motion over time, considering both horizontal and vertical components of velocity.
-
Visualization: The resulting trajectory is plotted using Matplotlib, providing a visual representation of the projectile's path.
- Clone the Repository:
git clone https://github.com/your-username/projectile-motion-simulation.git cd projectile-motion-simulation
Run the Script:
python projectile_simulation.py
Follow the on-screen prompts to input initial conditions such as initial position, velocity, launch angle, time step, and total simulation time.
The script will generate a plot illustrating the projectile's trajectory.
Initial Position (X, Y): The starting point of the projectile in a 2D space.
Initial Velocity: The magnitude of the initial velocity of the projectile.
Launch Angle: The angle at which the projectile is launched with respect to the horizontal axis.
Delta Time: The time step used in Euler's method for numerical integration.
Total Simulation Time: The overall duration of the simulation.
Inital X: 0 Inital Y: 0 Inital Velocity: 30 Lauch Angle: 45 Delta Time: 0.01 Time for simulation: 5
Python 3.x Matplotlib
Install the required dependencies using:
pip install matplotlib