Created
September 3, 2024 08:48
-
-
Save Cvar1984/1aec7a2016646da5bfd70873dc70df71 to your computer and use it in GitHub Desktop.
Find Gravity by free fall test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
io.write("Initial acceleration of the object in m/s: "); | |
local initial_velocity = io.read("*n") | |
io.write("Height in meter: ") | |
local height = io.read("*n") | |
io.write("Times the object is dropped from a height in sec: ") | |
local time = io.read("*n") | |
local gravity = 2 * (height - initial_velocity * time) / time ^ 2 | |
print(string.format("The acceleration due to gravity is: %s m/s^2", gravity)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment