senorprogrammer / mach_speed_calc

A Mach speed calculator class for Ruby.

This URL has Read+Write access

mach_speed_calc / README
100644 28 lines (18 sloc) 0.99 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Convert between Km/h or Miles/h and Mach speeds
 
  Copyright (c) 2007 Chris Cummer
    chris@postal-code.com
    
    This library is free software (as in beer and in speech); you may redistribute it and/or modify it
    under the same terms as the ruby language itself, see the file COPYING for details.
 
 
    Mach Number:
    
      Ratio of true airspeed to speed of sound in surrounding fluid (which varies as square
      root of absolute temperature). Mach 1 equals the speed of sound, which is 340.294 meters
      per second or 761.59 mph at sea level.
    
      The Mach number depends on the speed of sound in the gas and the speed of sound depends
      on the type of gas and the temperature of the gas.
    
      For the purposes of this class the gas is assumed to be common air.
    
    Usage:
    
      m = MachSpeedCalulator.new
      ms = m.kmh_to_mach( 120, 25 )
      => 0.0962977998319029
      
      km = m.mach_to_kmh( 0.0962977998319029, 25 )
      => 120.0