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

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +26 -0
app.py ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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()