Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
printf "Latitude? "
latitude_degrees = gets.to_f
latitude = latitude_degrees * Math::PI / 180.0
angular_velocity = 2 * Math::PI / (24 * 60 * 60) # Radians per second
radius_at_equator = 6_371_000 # meters
radius_at_latitude = radius_at_equator * Math.cos(latitude)
centripetal_at_equator = angular_velocity**2 * radius_at_equator
centripetal_at_latitude = angular_velocity**2 * radius_at_latitude
acceleration_at_equator = 9.8 - centripetal_at_equator
acceleration_at_latitude = 9.8 - centripetal_at_latitude
ratio = acceleration_at_equator / acceleration_at_latitude
weight_at_latitude = 100
weight_at_equator = weight_at_latitude * ratio
printf "If you weight 100 pounds at latitude %0.2f\n", latitude_degrees
printf "Then you will weight %0.2f pounds at the equator\n", weight_at_equator
printf "Which is %0.2f pounds lighter.\n", (weight_at_latitude - weight_at_equator)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.