Fix sphinx/build_docs warnings for physics/horizontal_projectile_motion (#12467)

This commit is contained in:
Maxim Smolskiy 2024-12-24 06:06:59 +03:00 committed by GitHub
parent 04fbfd6eae
commit e9721aad59
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,7 +1,9 @@
""" """
Horizontal Projectile Motion problem in physics. Horizontal Projectile Motion problem in physics.
This algorithm solves a specific problem in which This algorithm solves a specific problem in which
the motion starts from the ground as can be seen below: the motion starts from the ground as can be seen below::
(v = 0) (v = 0)
* * * *
* * * *
@ -10,6 +12,7 @@ the motion starts from the ground as can be seen below:
* * * *
* * * *
GROUND GROUND GROUND GROUND
For more info: https://en.wikipedia.org/wiki/Projectile_motion For more info: https://en.wikipedia.org/wiki/Projectile_motion
""" """
@ -43,14 +46,17 @@ def check_args(init_velocity: float, angle: float) -> None:
def horizontal_distance(init_velocity: float, angle: float) -> float: def horizontal_distance(init_velocity: float, angle: float) -> float:
""" r"""
Returns the horizontal distance that the object cover Returns the horizontal distance that the object cover
Formula: Formula:
v_0^2 * sin(2 * alpha) .. math::
--------------------- \frac{v_0^2 \cdot \sin(2 \alpha)}{g}
g
v_0 - initial velocity v_0 - \text{initial velocity}
alpha - angle
\alpha - \text{angle}
>>> horizontal_distance(30, 45) >>> horizontal_distance(30, 45)
91.77 91.77
>>> horizontal_distance(100, 78) >>> horizontal_distance(100, 78)
@ -70,14 +76,17 @@ def horizontal_distance(init_velocity: float, angle: float) -> float:
def max_height(init_velocity: float, angle: float) -> float: def max_height(init_velocity: float, angle: float) -> float:
""" r"""
Returns the maximum height that the object reach Returns the maximum height that the object reach
Formula: Formula:
v_0^2 * sin^2(alpha) .. math::
-------------------- \frac{v_0^2 \cdot \sin^2 (\alpha)}{2 g}
2g
v_0 - initial velocity v_0 - \text{initial velocity}
alpha - angle
\alpha - \text{angle}
>>> max_height(30, 45) >>> max_height(30, 45)
22.94 22.94
>>> max_height(100, 78) >>> max_height(100, 78)
@ -97,14 +106,17 @@ def max_height(init_velocity: float, angle: float) -> float:
def total_time(init_velocity: float, angle: float) -> float: def total_time(init_velocity: float, angle: float) -> float:
""" r"""
Returns total time of the motion Returns total time of the motion
Formula: Formula:
2 * v_0 * sin(alpha) .. math::
-------------------- \frac{2 v_0 \cdot \sin (\alpha)}{g}
g
v_0 - initial velocity v_0 - \text{initial velocity}
alpha - angle
\alpha - \text{angle}
>>> total_time(30, 45) >>> total_time(30, 45)
4.33 4.33
>>> total_time(100, 78) >>> total_time(100, 78)
@ -125,6 +137,8 @@ def total_time(init_velocity: float, angle: float) -> float:
def test_motion() -> None: def test_motion() -> None:
""" """
Test motion
>>> test_motion() >>> test_motion()
""" """
v0, angle = 25, 20 v0, angle = 25, 20