Last active
January 3, 2016 01:59
-
-
Save simplyluke/8392811 to your computer and use it in GitHub Desktop.
the bridge problem
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
def higher(x): | |
a = (x-252.0)**2.0 | |
b = a/(-824.0) | |
return b + 136 - 59 | |
def lower(x): | |
a = (x-252.0)**2.0 | |
b = a/(-538.1695) | |
return b + 118 - 59 | |
dist = [252, 202, 152, 52] | |
for x in dist: | |
print("The higher bridge at " + str(x) + " meters is " + str(higher(x)) + " meters high") | |
print("The lower bridge at " + str(x) + " meters is " + str(lower(x)) + " meters high") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment