simulation.py: add
This commit is contained in:
parent
d3e60e6d5a
commit
188855e5d2
1 changed files with 10 additions and 0 deletions
10
simulation.py
Normal file
10
simulation.py
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
# a funny python file
|
||||||
|
|
||||||
|
# Simulation of a falling body on Earth
|
||||||
|
ACCELERATION_G = 10 # m/s^2
|
||||||
|
TIME = 5.0 # seconds
|
||||||
|
|
||||||
|
def calculate_displacement(g, t):
|
||||||
|
return 0.5 * g * (t ** 2)
|
||||||
|
|
||||||
|
print(f"Displacement after {TIME}s: {calculate_displacement(ACCELERATION_G,TIME)} meters")
|
||||||
Loading…
Add table
Add a link
Reference in a new issue