Spaces:
Runtime error
Runtime error
import gradio as gr | |
gr.Markdown(""" | |
The range of a projectile is the horizontal distance it travels during its motion. The horizontal displacement of a projectile at any time can be calculated using the following kinematic equation: | |
$$x = x_0 + v_0 \cos \theta \cdot t$$ | |
where $x$ is the horizontal displacement, $x_0$ is the initial horizontal position, $v_0$ is the initial velocity, $\theta$ is the angle at which the projectile is launched, and $t$ is the time. | |
To find the range of the projectile, we need to find the time at which it hits the ground (i.e., when its vertical displacement becomes zero). The vertical displacement of a projectile at any time can be calculated using the following kinematic equation: | |
$$y = y_0 + v_0 \sin \theta \cdot t - \frac{1}{2}gt^2$$ | |
where $y$ is the vertical displacement, $y_0$ is the initial vertical position, $v_0$ is the initial velocity, $\theta$ is the angle at which the projectile is launched, $t$ is the time, $g$ is the acceleration due to gravity, and $t$ is the time. | |
To find the time at which the projectile hits the ground, we can set the vertical displacement to zero and solve for $t$. This gives us the following equation: | |
$$0 = y_0 + v_0 \sin \theta \cdot t - \frac{1}{2}gt^2$$ | |
Solving for $t$, we get: | |
$$t = \frac{v_0 \sin \theta \pm \sqrt{v_0^2 \sin^2 \theta + 2gy_0}}{g}$$ | |
Since the projectile will hit the ground at a later time, we need to take the positive value of $t$. Substituting this value into the equation for horizontal displacement, we get the following equation for the range of the projectile: | |
""").launch() |