Method Deck / units

Speed conversion

Converts a speed between m/s, km/h, mph, knots, and ft/s using exact NIST SP 811 length and time definitions.

Published for review. The Founder is checking every card himself; anything he strikes comes down the same hour.

Try it

Inputs

Outputs

Steps

  1. Look up the exact meters-per-second equivalent of from_unit and of to_unit.
  2. Convert the input to m/s: mps = value * ms_per(from_unit).
  3. Convert m/s to the target unit: result = mps / ms_per(to_unit).
  4. Round result to 6 significant figures.

Constants

Sources

Worked example and test vectors

NameInputsAnswer
worked example{"value":100,"from_unit":"km_h","to_unit":"mph"}62.1371 mph
test vector: knot to km/h{"value":1,"from_unit":"knot","to_unit":"km_h"}1.85200 km/h
test vector: mph to ft/s{"value":60,"from_unit":"mph","to_unit":"ft_s"}88.0000 ft/s

Published card