Skip to content

Instantly share code, notes, and snippets.

@creimers
Last active May 3, 2021 14:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save creimers/a6a7042495cc3d27e165856ba76d4f9b to your computer and use it in GitHub Desktop.
Save creimers/a6a7042495cc3d27e165856ba76d4f9b to your computer and use it in GitHub Desktop.
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