Created
September 3, 2024 06:53
-
-
Save Cvar1984/f98e4ae925bcbf1d7e136a3e2efebef6 to your computer and use it in GitHub Desktop.
Find alpha degrees for suncalc
This file contains 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 function degrees(radians) | |
return radians * 180 / math.pi | |
end | |
io.write("Height of the pole: ") | |
local height = io.read("*n") | |
io.write("Length of the shadow: ") | |
local wide = io.read("*n") | |
local tan_alpha = height / wide | |
local alpha_radian = math.atan(tan_alpha) | |
local alpha_degree = degrees(alpha_radian) | |
print("Alpha:", alpha_degree, "deg") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment