home *** CD-ROM | disk | FTP | other *** search
/ Boston 2 / boston-2.iso / DOS / PROGRAM / C / UNITS / UNIT_TAB.H < prev   
Text File  |  1993-12-01  |  8KB  |  210 lines

  1. /* unit_table.h - Copyright 1987 - Gregory R. Simpson */
  2. /* subject to the same conditions outlined in u.c's copyright */
  3.  
  4. /* ************ a table of the form: ************** 
  5.  
  6.     struct of_units {
  7.            char  *name;        Name of Unit 
  8.            float value;        Value - Initially set to 0 
  9.            float conversion;   Conversion factor to Primary Unit 
  10.            int   counter;      Number of units in this group 
  11.     } 
  12.  
  13. The primary unit is the first unit listed in the unit group.
  14. Always include an even number of entries in the group even
  15. if this means that the last entry is blank. Then, set the
  16. number of entries to the correct odd number...this is to
  17. handle displays correctly... For example, see the mass
  18. entry below.
  19.  
  20. Bug... I should include the Unit Group Menu info in this
  21. file in order to make it easier to include more unit types.
  22.      -simpsong
  23. ************************************************** */
  24.  
  25. unit[30][20] = {
  26.        {
  27.               {"feet",0,1,18},                      /* length */
  28.               {"inches",0,12,18},
  29.               {"yards",0,.33333333,18},
  30.               {"centimeters",0,30.48,18},
  31.               {"meters",0,.3048,18}, 
  32.               {"kilometers",0,3.048e-04,18},
  33.               {"statute miles",0,1.894e-04,18},
  34.               {"nautical miles",0,1.6457925e-04,18},
  35.               {"par-secs",0,9.8827862e-18,18},
  36.               {"light-years",0,3.2218301e-17,18},
  37.               {"mils",0,12000.,18},
  38.               {"microns",0,304800.,18},
  39.               {"millimicrons",0,3.048e08,18},
  40.               {"angstroms",0,3.048e09,18},
  41.               {"x-units",0,3.048e12,18},
  42.               {"rods",0,.060606,18},
  43.               {"fathoms",0,.16666667,18},
  44.               {"furlongs",0,1.51515e-03,18}
  45.        },
  46.        {
  47.               {"pounds",0,1,7},                    /* mass */
  48.               {"grams",0,453.6,7},
  49.               {"kilograms",0,.4536,7},
  50.               {"tons",0,5.0e-04,7},
  51.               {"amus",0,2.732e26,7},
  52.               {"ounces",0,16,7},
  53.               {"stones",0,.0714285,7},
  54.               {"",0,0,7}
  55.        },
  56.        {
  57.               {"m/sec",0,1,6},                     /* speed */
  58.               {"ft/sec",0,3.281,6},
  59.               {"km/hr",0,3.6,6},
  60.               {"cm/sec",0,100,6},
  61.               {"knots",0,1.944,6},
  62.               {"miles/hr",0,2.237,6},
  63.               {"",0,0,7}
  64.        },
  65.        {
  66.               {"cubic meters",0,1,10},                          /* Volume */
  67.               {"cubic cms",0,1e06,10},
  68.               {"liters",0,1000,10},
  69.               {"gallons",0,264.20079,10},
  70.               {"cubic feet",0,35.31,10},
  71.               {"cubic inches",0,6.102e04,10},
  72.               {"barrels",0,11096.433,10},
  73.               {"hogsheads",0,5548.2166,10},
  74.               {"boardfeet",0,8786880.,10},
  75.               {"cords",0,4519.68,10}
  76.        },
  77.        {
  78.               {"square meters",0,1,6},                          /* Area */
  79.               {"square cms",0,1e04,6},
  80.               {"square feet",0,10.76,6},
  81.               {"square inches",0,1550,6},
  82.               {"circular mills",0,1.974e09,6},
  83.               {"acres",0,2.4709661e-04,6}
  84.        },
  85.        {
  86.               {"kg/m3",0,1,5},                          /* Density */
  87.               {"slug/ft3",0,1.940e-03,5},
  88.               {"gm/cm3",0,.001,5},
  89.               {"lb/ft3",0,6.243e-02,5},
  90.               {"lb/in3",0,3.613e-05,5},
  91.               {"",0,0,5}
  92.        },
  93.        {
  94.               {"days",0,1,10},                          /* Time */
  95.               {"years",0,2.738e-03,10},
  96.               {"hours",0,24,10},
  97.               {"minutes",0,1440,10},
  98.               {"seconds",0,8.640e04,10},
  99.               {"decades",0,2.738e-04,10},
  100.               {"score",0,1.369e-04,10},
  101.               {"centuries",0,2.738e-05,10},
  102.               {"millenia",0,2.738e-06,10},
  103.               {"fortnights",0,.0714285,10}
  104.        },
  105.        {
  106.               {"newtons",0,1,5},                          /* Force */
  107.               {"dynes",0,1e05,5},
  108.               {"pounds",0,.2248,5},
  109.               {"gram-force",0,102.0,5},
  110.               {"kilogram-force",0,.1020,5},
  111.               {"",0,0,5}
  112.        },
  113.        {
  114.               {"btus",0,1,9},                          /* Energy */
  115.               {"ergs",0,1.055e10,9},
  116.               {"ft-lbs",0,777.9,9},
  117.               {"hp-hr",0,3.929e-04,9},
  118.               {"joules",0,1055,9},
  119.               {"calories",0,252.0,9},
  120.               {"kilowatt-hours",0,2.930e-04,9},
  121.               {"electron volts",0,6.585e21,9},
  122.               {"MeV",0,6.585e15,9},
  123.               {"",0,0,9}
  124.        },
  125.        {
  126.               {"atmospheres",0,1,12},                  /* Pressure */
  127.               {"dynes/cm2",0,1.013e06,12},
  128.               {"inches of water",0,406.8,12},
  129.               {"cms Hg",0,76.,12},
  130.               {"torr",0,760.,12},
  131.               {"mms Hg",0,760.,12},
  132.               {"inches Hg",0,29.92126,12},
  133.               {"lbs/in2",0,14.70,12},
  134.               {"lbs/ft2",0,2116,12},
  135.               {"newtons/m2",0,1.013e05,12},
  136.               {"bars",0,1.0133,12},
  137.               {"pascals",0,1.013e05,12}
  138.        },
  139.        {
  140.               {"degrees",0,1,5},                          /* Plane Angles */
  141.               {"minutes",0,60,5},
  142.               {"seconds",0,3600,5},
  143.               {"radians",0,1.745e-02,5},
  144.               {"revolutions",0,2.77777778e-03,5},
  145.               {"",0,0,5}
  146.        },
  147.        {
  148.               {"btus/hour",0,1,7},                          /* Power */
  149.               {"ft-lbs/min",0,12.97,7},
  150.               {"ft-lbs/sec",0,.2161,7},
  151.               {"horsepower",0,3.929e-04,7},
  152.               {"kilowatts",0,2.930e-04,7},
  153.               {"watts",0,.2930,7},
  154.               {"calories/sec",0,7.000,7},
  155.               {"",0,0,7}
  156.        },
  157.        {
  158.               {"coulombs",0,1,6},                        /* Electric Charge */
  159.               {"abcoulombs",0,.1,6},
  160.               {"amp-hrs",0,2.778e-04,6},
  161.               {"faradays",0,1.036e-05,6},
  162.               {"statcoulombs",0,2.998e9,6},
  163.               {"electron charges",0,6.2414181e18,6}
  164.        },
  165.        {
  166.               {"gauss",0,1,5},                        /* Magnetic Induction */
  167.               {"kilolines/in2",0,6.452e-03,5},
  168.               {"webers/m2",0,1e-04,5},
  169.               {"tesla",0,1e-04,5},
  170.               {"gamma",0,1e05,5},
  171.               {"",0,0,5}
  172.        },
  173.        {
  174.               {"Footlamberts",0,1,7},                          /* Light */
  175.               {"Nit",0,.2919,7},
  176.               {"Millilamberts",0,.929,7},
  177.               {"Candelas/in2",0,452,7},
  178.               {"Candelas/ft2",0,3.142,7},
  179.               {"Candelas/m2",0,.2919,7},
  180.               {"Stilb",0,2919,7},
  181.               {"",0,1,7}
  182.        },
  183.        {
  184.               {"Btu/(hr-ft2-F/ft)",0,1,4},          /* thermal conductivity */
  185.               {"gm-cal/(sec-cm2-C/cm)",0,.004134,4},
  186.               {"watts/(cm2-C/cm)",0,.01731,4},
  187.               {"kg-cal/(hr-m2-C/m)",0,1.488,4}
  188.        },
  189.        {
  190.               {"Btu/hr-ft2-F",0,1,4},     /* coeff. of heat trans. */
  191.               {"gm-cal/sec-cm2-C",0,.0001355,4},
  192.               {"watts/cm2-C",0,.0005678,4},
  193.               {"kg-cal/hr-m2-C",0,4.882,4}
  194.        },
  195.        {
  196.               {"Btu/hr-ft2",0,1,4},                          /* heat Flux */
  197.               {"gm-cal/sec-cm2",0,.00007535,4},
  198.               {"watts/cm2",0,.0003154,4},
  199.               {"kg-cal/hr-m2",0,2.712,4}
  200.        },
  201.        {
  202.               {"Centipoises",0,1,5},             /* viscosity */
  203.               {"lb/sec-ft",0,.000672,5}, 
  204.               {"lb force-sec/ft2",0,.0000209,5},
  205.               {"lb/hr-ft",0,2.42,5},
  206.               {"kg/hr-m",0,3.60,5},
  207.               {"",0,1,5}
  208.        },
  209. };
  210.