speedcalc: further systematize unit factor calculation
authorMichael Adam <obnox@samba.org>
Tue, 3 Nov 2015 10:14:28 +0000 (11:14 +0100)
committerMichael Adam <obnox@samba.org>
Tue, 3 Nov 2015 10:15:19 +0000 (11:15 +0100)
Signed-off-by: Michael Adam <obnox@samba.org>
speedcalc

index 1fbabe9..ab04848 100755 (executable)
--- a/speedcalc
+++ b/speedcalc
@@ -109,9 +109,9 @@ $Unit_factor[DISTANCE] = {
     "mi" => 1609.344,
 };
 $Unit_factor[SPEED] = {
-    "m/s"  => ,
+    "m/s"  => $Unit_factor[DISTANCE]->{"m"}  / $Unit_factor[TIME]->{"s"},
     "km/h" => $Unit_factor[DISTANCE]->{"km"} / $Unit_factor[TIME]->{"h"},
-    "yd/s" => $Unit_factor[DISTANCE]->{"yd"},
+    "yd/s" => $Unit_factor[DISTANCE]->{"yd"} / $Unit_factor[TIME]->{"s"},
     "mi/h" => $Unit_factor[DISTANCE]->{"mi"} / $Unit_factor[TIME]->{"h"},
 };