Projectile Motion Fundamentals
Projectile motion describes the movement of an object launched into the air, subject only to gravity (assuming air resistance is negligible). This motion can be understood by splitting it into two independent components: horizontal and vertical. The horizontal motion is uniform (constant velocity), while the vertical motion is uniformly accelerated due to gravity.
The key equations governing projectile motion are:
-
Horizontal position:
x(t) = v0 * cos(θ) * t -
Vertical position:
y(t) = v0 * sin(θ) * t - (1/2) * g * t^2
Where:
v0is the initial speed;θis the launch angle (from the horizontal);gis the acceleration due to gravity (9.81 m/s²);tis the elapsed time.
These equations allow you to predict the projectile's position at any moment after launch.
1234567891011121314151617181920212223import numpy as np # Initial conditions v0 = 20.0 # initial speed in m/s theta_deg = 45.0 # launch angle in degrees g = 9.81 # acceleration due to gravity in m/s^2 # Convert angle to radians theta = np.radians(theta_deg) # Time of flight t_flight = 2 * v0 * np.sin(theta) / g # Time intervals t_points = np.linspace(0, t_flight, num=50) # Calculate positions x_points = v0 * np.cos(theta) * t_points y_points = v0 * np.sin(theta) * t_points - 0.5 * g * t_points**2 # Display positions at each time step for t, x, y in zip(t_points, x_points, y_points): print(f"Time: {t:.2f} s, X: {x:.2f} m, Y: {y:.2f} m")
In this code, you first set the initial speed (v0), launch angle (theta_deg), and gravitational acceleration (g). The launch angle is converted to radians for calculation. The total time the projectile spends in the air (t_flight) is computed using the vertical motion formula, considering the time to rise and fall back to the starting height.
You then generate a series of time points from launch (t = 0) to landing (t = t_flight). For each time point, the horizontal position (x_points) is calculated using v0 * cos(θ) * t, reflecting constant horizontal velocity. The vertical position (y_points) is found using v0 * sin(θ) * t - 0.5 * g * t^2, which accounts for the initial upward velocity and the downward pull of gravity. The loop prints the projectile's position at each time step, allowing you to track its path through the air.
123456789import matplotlib.pyplot as plt plt.figure(figsize=(8, 4)) plt.plot(x_points, y_points, marker="o") plt.title("Projectile Motion Trajectory") plt.xlabel("Horizontal Position (m)") plt.ylabel("Vertical Position (m)") plt.grid(True) plt.show()
1. What factors determine the range of a projectile in the simulation?
2. How does changing the launch angle affect the shape of the trajectory?
3. Fill in the blank: The vertical position of a projectile at time t is given by y = ___ - (1/2)gt^2.
Takk for tilbakemeldingene dine!
Spør AI
Spør AI
Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår
Can you explain how the time of flight is calculated?
What happens if I change the launch angle or initial speed?
Can you show how to plot the trajectory of the projectile?
Fantastisk!
Completion rate forbedret til 4.76
Projectile Motion Fundamentals
Sveip for å vise menyen
Projectile motion describes the movement of an object launched into the air, subject only to gravity (assuming air resistance is negligible). This motion can be understood by splitting it into two independent components: horizontal and vertical. The horizontal motion is uniform (constant velocity), while the vertical motion is uniformly accelerated due to gravity.
The key equations governing projectile motion are:
-
Horizontal position:
x(t) = v0 * cos(θ) * t -
Vertical position:
y(t) = v0 * sin(θ) * t - (1/2) * g * t^2
Where:
v0is the initial speed;θis the launch angle (from the horizontal);gis the acceleration due to gravity (9.81 m/s²);tis the elapsed time.
These equations allow you to predict the projectile's position at any moment after launch.
1234567891011121314151617181920212223import numpy as np # Initial conditions v0 = 20.0 # initial speed in m/s theta_deg = 45.0 # launch angle in degrees g = 9.81 # acceleration due to gravity in m/s^2 # Convert angle to radians theta = np.radians(theta_deg) # Time of flight t_flight = 2 * v0 * np.sin(theta) / g # Time intervals t_points = np.linspace(0, t_flight, num=50) # Calculate positions x_points = v0 * np.cos(theta) * t_points y_points = v0 * np.sin(theta) * t_points - 0.5 * g * t_points**2 # Display positions at each time step for t, x, y in zip(t_points, x_points, y_points): print(f"Time: {t:.2f} s, X: {x:.2f} m, Y: {y:.2f} m")
In this code, you first set the initial speed (v0), launch angle (theta_deg), and gravitational acceleration (g). The launch angle is converted to radians for calculation. The total time the projectile spends in the air (t_flight) is computed using the vertical motion formula, considering the time to rise and fall back to the starting height.
You then generate a series of time points from launch (t = 0) to landing (t = t_flight). For each time point, the horizontal position (x_points) is calculated using v0 * cos(θ) * t, reflecting constant horizontal velocity. The vertical position (y_points) is found using v0 * sin(θ) * t - 0.5 * g * t^2, which accounts for the initial upward velocity and the downward pull of gravity. The loop prints the projectile's position at each time step, allowing you to track its path through the air.
123456789import matplotlib.pyplot as plt plt.figure(figsize=(8, 4)) plt.plot(x_points, y_points, marker="o") plt.title("Projectile Motion Trajectory") plt.xlabel("Horizontal Position (m)") plt.ylabel("Vertical Position (m)") plt.grid(True) plt.show()
1. What factors determine the range of a projectile in the simulation?
2. How does changing the launch angle affect the shape of the trajectory?
3. Fill in the blank: The vertical position of a projectile at time t is given by y = ___ - (1/2)gt^2.
Takk for tilbakemeldingene dine!