diff options
author | George Abbott <george@gabbott.dev> | 2023-10-31 17:54:07 +0000 |
---|---|---|
committer | George Abbott <george@gabbott.dev> | 2023-10-31 17:54:07 +0000 |
commit | 4d0bd914e7c1ee65f4036e60149a7b891906a5d3 (patch) | |
tree | c2a6751823e064e003cd4f6166df07bfc106d7eb /web/mount-ave-speeds |
Commit all to date.
Diffstat (limited to 'web/mount-ave-speeds')
-rwxr-xr-x | web/mount-ave-speeds | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/web/mount-ave-speeds b/web/mount-ave-speeds new file mode 100755 index 0000000..bc2df4e --- /dev/null +++ b/web/mount-ave-speeds @@ -0,0 +1,19 @@ +#!/usr/bin/env ruby + +# Run as +# mount-ave-speeds <time-in-secs> +# And get back the kph and mph. + +time = ARGV[0].to_i +km2m_constant = 0.6213712 +time_h = time / (60.0 * 60.0) +km = 0.47 + +kph = (km / time_h) +mph = kph * km2m_constant + +print "Time taken: ", time, "\n" +print "KPH: ", kph.round(2), "\n" +print "MPH: ", mph.round(2), "\n" + + |