From bbd7b4bec8d1185242169dc5dc4dcaeebcb955b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20L=C3=B8vbr=C3=B8tte=20Olsen?= Date: Wed, 30 Aug 2017 01:37:56 +0200 Subject: [PATCH] Create kick.py Who uses py2 anyways --- misc/challenges/kick.py | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 misc/challenges/kick.py diff --git a/misc/challenges/kick.py b/misc/challenges/kick.py new file mode 100644 index 0000000..cf569e5 --- /dev/null +++ b/misc/challenges/kick.py @@ -0,0 +1,41 @@ +import math +# ms^-2 = m / s^2 +g = 9.81 +# kg m^-3 = kg/m^3 +air_density = 1.2 + +def cross_section(a): + return math.pi*a**2 + +def F_g(m): + return m*g + +def F_d(drag_coeffcient, cross_section, velocity): + return 0.5*drag_coeffcient*air_density*cross_section*velocity**2 + +# m +football_radius = 0.11 +# kg +football_mass = 0.43 + +football_drag_coefficient = 0.4 + +#m/s +# 120 km/h = 33.33 m/s +V_hard = 33.33 +# 30 km/h = 8.33 m/s +V_soft = 08.33 + +#Newton +F_d_hard = F_d(football_drag_coefficient, cross_section(football_radius), V_hard) +F_d_soft = F_d(football_drag_coefficient, cross_section(football_radius), V_soft) + +#Newton +F_g = F_g(football_mass) + +print "Hard kick drag: ", str(round(F_d_hard, 1)), "N" +print "Soft Kick drag: ", str(round(F_d_soft, 1)), "N" +print "gravitation force:", str(round(F_g, 1)), "N" + +print "Hard kick ratio: ", F_d_hard/F_g +print "Soft kick ratio: ", F_d_soft/F_g