/Projectile-Motion-Simulation

Accurately simulate the motion of a projectile

Primary LanguagePython

Projectile Motion Simulation

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.

Features

  • 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.

Usage

  1. 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.

View the Trajectory:

The script will generate a plot illustrating the projectile's trajectory.

Parameters

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

Dependencies

Python 3.x Matplotlib

Install the required dependencies using:

pip install matplotlib