Pretty self explanatory. It may not work with latitudinal lengths.
I found a YouTube video by Mark Rober telling me the physics behind the algorithm (x squared times 16) for this project. He also made an app called Cliff Height Timer. You can go check that out in the app store. Anyways, I'd like to give a shout-out to him. Other than that I made this entirely by myself.