Created
September 2, 2024 07:05
-
-
Save Cvar1984/dab66885ff8b16d6d1f737cb1dcc7e52 to your computer and use it in GitHub Desktop.
Determine your height with time
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
local initial_velocity, time, gravity, height; | |
-- The gravitational acceleration of the Earth is 9.80665 m/s². | |
gravity = 9.80665; | |
io.write("Initial acceleration of the object: "); | |
initial_velocity = io.read("*n"); | |
io.write("Times the object is dropped from a height: "); | |
time = io.read("*n"); | |
height = initial_velocity * time + 0.5 * gravity * time ^ 2; | |
print("Your height: ", height); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment