Last active
May 3, 2021 14:59
-
-
Save creimers/a6a7042495cc3d27e165856ba76d4f9b to your computer and use it in GitHub Desktop.
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
import math | |
def calculate_transition_length( | |
radius: float, | |
ramp_height: float, | |
table_length: float) -> float: | |
height_ratio = ramp_height / radius | |
alpha = math.asin(1 - height_ratio) | |
length = math.cos(alpha) * radius | |
return round(length + table_length, 2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment