abidlabs HF staff commited on
Commit
b6e3b93
1 Parent(s): b359774

Update app.py

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