From 4b300c3d5c35ee6a3ac0cea1b978ba130bdc4171 Mon Sep 17 00:00:00 2001 From: MaximSmolskiy Date: Tue, 24 Dec 2024 04:06:06 +0300 Subject: [PATCH 1/4] Fix sphinx/build_docs warnings for physics/newtons_second_law_of_motion --- physics/newtons_second_law_of_motion.py | 81 ++++++++++++++----------- 1 file changed, 46 insertions(+), 35 deletions(-) diff --git a/physics/newtons_second_law_of_motion.py b/physics/newtons_second_law_of_motion.py index 53fab6ce78b9..7a55b3d0338f 100644 --- a/physics/newtons_second_law_of_motion.py +++ b/physics/newtons_second_law_of_motion.py @@ -1,18 +1,23 @@ -""" -Description : -Newton's second law of motion pertains to the behavior of objects for which -all existing forces are not balanced. -The second law states that the acceleration of an object is dependent upon two variables -- the net force acting upon the object and the mass of the object. -The acceleration of an object depends directly -upon the net force acting upon the object, -and inversely upon the mass of the object. -As the force acting upon an object is increased, -the acceleration of the object is increased. -As the mass of an object is increased, the acceleration of the object is decreased. +r""" +Description: + Newton's second law of motion pertains to the behavior of objects for which + all existing forces are not balanced. + The second law states that the acceleration of an object is dependent upon two variables + - the net force acting upon the object and the mass of the object. + The acceleration of an object depends directly + upon the net force acting upon the object, + and inversely upon the mass of the object. + As the force acting upon an object is increased, + the acceleration of the object is increased. + As the mass of an object is increased, the acceleration of the object is decreased. + Source: https://www.physicsclassroom.com/class/newtlaws/Lesson-3/Newton-s-Second-Law -Formulation: Fnet = m • a -Diagrammatic Explanation: + +Formulation: + .. math:: F_{net} = m \cdot a + +Diagrammatic Explanation:: + Forces are unbalanced | | @@ -26,29 +31,35 @@ / \ / \ / \ - __________________ ____ ________________ - |The acceleration | |The acceleration | - |depends directly | |depends inversely | - |on the net Force | |upon the object's | - |_________________| |mass_______________| + __________________ ____________________ + | The acceleration | | The acceleration | + | depends directly | | depends inversely | + | on the net Force | | upon the object's | + | | | mass | + |__________________| |____________________| + Units: -1 Newton = 1 kg X meters / (seconds^2) + .. math:: 1 \ Newton = 1 \ kg \times \frac{meters}{seconds^2} + How to use? -Inputs: - ___________________________________________________ - |Name | Units | Type | - |-------------|-------------------------|-----------| - |mass | (in kgs) | float | - |-------------|-------------------------|-----------| - |acceleration | (in meters/(seconds^2)) | float | - |_____________|_________________________|___________| - -Output: - ___________________________________________________ - |Name | Units | Type | - |-------------|-------------------------|-----------| - |force | (in Newtons) | float | - |_____________|_________________________|___________| + +Inputs:: + + ______________ _____________________ ___________ + | Name | Units | Type | + |--------------|---------------------|-----------| + | mass | in kgs | float | + |--------------|---------------------|-----------| + | acceleration | in meters/seconds^2 | float | + |______________|_____________________|___________| + +Output:: + + ______________ _______________________ ___________ + | Name | Units | Type | + |--------------|-----------------------|-----------| + | force | in Newtons | float | + |______________|_______________________|___________| """ From ed4f7429a6f4b11a71e8d6a972c4bcc1033f0f2d Mon Sep 17 00:00:00 2001 From: MaximSmolskiy Date: Sun, 29 Dec 2024 17:59:06 +0300 Subject: [PATCH 2/4] Fix --- physics/newtons_second_law_of_motion.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/physics/newtons_second_law_of_motion.py b/physics/newtons_second_law_of_motion.py index 7a55b3d0338f..c34f15cffc10 100644 --- a/physics/newtons_second_law_of_motion.py +++ b/physics/newtons_second_law_of_motion.py @@ -2,8 +2,8 @@ Description: Newton's second law of motion pertains to the behavior of objects for which all existing forces are not balanced. - The second law states that the acceleration of an object is dependent upon two variables - - the net force acting upon the object and the mass of the object. + The second law states that the acceleration of an object is dependent upon + two variables - the net force acting upon the object and the mass of the object. The acceleration of an object depends directly upon the net force acting upon the object, and inversely upon the mass of the object. From b6f8440ca9335921ec053c13a64522e764c5d824 Mon Sep 17 00:00:00 2001 From: MaximSmolskiy Date: Sun, 29 Dec 2024 18:04:23 +0300 Subject: [PATCH 3/4] Fix --- physics/newtons_second_law_of_motion.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/physics/newtons_second_law_of_motion.py b/physics/newtons_second_law_of_motion.py index c34f15cffc10..59999707dfbe 100644 --- a/physics/newtons_second_law_of_motion.py +++ b/physics/newtons_second_law_of_motion.py @@ -34,7 +34,7 @@ __________________ ____________________ | The acceleration | | The acceleration | | depends directly | | depends inversely | - | on the net Force | | upon the object's | + | on the net force | | upon the object's | | | | mass | |__________________| |____________________| @@ -66,6 +66,8 @@ def newtons_second_law_of_motion(mass: float, acceleration: float) -> float: """ + Calculates force from `mass` and `acceleration` + >>> newtons_second_law_of_motion(10, 10) 100 >>> newtons_second_law_of_motion(2.0, 1) From a3ba1f1a3af78e71de19b047c586cd95e438d457 Mon Sep 17 00:00:00 2001 From: MaximSmolskiy Date: Sun, 29 Dec 2024 18:38:40 +0300 Subject: [PATCH 4/4] Fix review issue --- physics/newtons_second_law_of_motion.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/physics/newtons_second_law_of_motion.py b/physics/newtons_second_law_of_motion.py index 59999707dfbe..4149e2494f31 100644 --- a/physics/newtons_second_law_of_motion.py +++ b/physics/newtons_second_law_of_motion.py @@ -13,8 +13,7 @@ Source: https://www.physicsclassroom.com/class/newtlaws/Lesson-3/Newton-s-Second-Law -Formulation: - .. math:: F_{net} = m \cdot a +Formulation: F_net = m • a Diagrammatic Explanation:: @@ -38,8 +37,7 @@ | | | mass | |__________________| |____________________| -Units: - .. math:: 1 \ Newton = 1 \ kg \times \frac{meters}{seconds^2} +Units: 1 Newton = 1 kg • meters/seconds^2 How to use?