Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,26 +1,29 @@
|
|
1 |
import gradio as gr
|
2 |
|
3 |
-
gr.
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
+
with gr.Blocks() as demo:
|
4 |
+
gr.Markdown("""
|
5 |
+
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:
|
6 |
+
|
7 |
+
$$x = x_0 + v_0 \cos \theta \cdot t$$
|
8 |
+
|
9 |
+
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.
|
10 |
+
|
11 |
+
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:
|
12 |
+
|
13 |
+
$$y = y_0 + v_0 \sin \theta \cdot t - \frac{1}{2}gt^2$$
|
14 |
+
|
15 |
+
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.
|
16 |
+
|
17 |
+
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:
|
18 |
+
|
19 |
+
$$0 = y_0 + v_0 \sin \theta \cdot t - \frac{1}{2}gt^2$$
|
20 |
+
|
21 |
+
Solving for $t$, we get:
|
22 |
+
|
23 |
+
$$t = \frac{v_0 \sin \theta \pm \sqrt{v_0^2 \sin^2 \theta + 2gy_0}}{g}$$
|
24 |
+
|
25 |
+
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:
|
26 |
+
|
27 |
+
""")
|
28 |
+
|
29 |
+
demo.launch()
|