home *** CD-ROM | disk | FTP | other *** search
/ Programmer's ROM - The Computer Language Library / programmersrom.iso / ada / piwg / z000014.ada < prev    next >
Encoding:
Text File  |  1988-05-03  |  11.0 KB  |  376 lines

  1.  
  2. package PHYSICAL_CONVERSION_CONSTANT is
  3.  
  4. -- short names for constants used to derive other constants
  5.   C : constant := 2.997925E8 ;
  6.   PI : constant := 3.14159 ;
  7.  
  8. --
  9. -- length
  10. --
  11.   FOOT_TO_METER : constant := 0.3048 ; -- exact 
  12.   METER_TO_FOOT : constant := 1.0 / FOOT_TO_METER ;
  13.   FOOT_TO_MIL : constant := 12.0 * 1000.0 ;
  14.   FOOT_TO_INCH : constant := 12.0 ;
  15.   FOOT_TO_YARD : constant := 1.0 / 3.0 ;
  16.   FOOT_TO_FATHOM : constant := 1.0 / 6.0 ;
  17.   FOOT_TO_CABLES_LENGTH : constant := FOOT_TO_FATHOM / 100.0 ;
  18.   FOOT_TO_CABLES_LENGTH_U_S_NAVY : constant := FOOT_TO_FATHOM / 120.0 ;
  19.   FOOT_TO_ROD : constant := 1.0 / 16.5 ;  -- also POLE or PERCH
  20.   FOOT_TO_LINK_SURVEYOR : constant := 100.0 / 66.0 ;  -- 1/100 chain
  21.   FOOT_TO_CHAIN_SURVEYOR : constant := 1.0 / 66.0 ;  -- or Gunter's 1/80 mile
  22.   FOOT_TO_LINK_ENGINEER : constant := 1.0 ;
  23.   FOOT_TO_CHAIN_ENGINEER : constant := 1.0 / 100.0 ;
  24.   FOOT_TO_FURLONG : constant := 1.0 / 660.0 ;  -- 40 rods or 1/8 mile
  25.   FOOT_TO_MILE_STATUTE : constant := 1.0 / 5280 ;
  26.   FOOT_TO_MILE_NAUTICAL : constant := 1.0 / 6000.0 ;  -- 10 CABLES_LENGTH
  27.  
  28. --                      length of a minute of longitude at the equator
  29. --                      exactly 1.852 kilometers
  30.   FOOT_TO_MILE_NAUTICAL_INTERNATIONAL : constant := 1.0 / 6076.11549 ;
  31.   FOOT_TO_LEAGUE_LAND : constant := FOOT_TO_MILE_STATUTE / 3.0 ;
  32.   FOOT_TO_LEAGUE_MARINE : constant := FOOT_TO_MILE_NAUTICAL / 3.0 ;
  33.   FOOT_TO_LIGHT_YEAR : constant := 1.0 / 3.103647E16 ;
  34.   MILE_TO_FOOT : constant := 5_280.0 ;
  35.   METER_TO_PICOMETER : constant := 1.0E12 ;
  36.   METER_TO_ANGSTROM : constant := 1.0E10 ;
  37.   METER_TO_NANOMETER : constant := 1.0E9 ;
  38.   METER_TO_MICROMETER : constant := 1.0E6 ;
  39.   METER_TO_MILLIMETER : constant := 1000.0 ;
  40.   METER_TO_CENTIMETER : constant := 100.0 ;
  41.   METER_TO_DECIMETER : constant := 10.0 ;
  42.   METER_TO_DECAMETER : constant := 0.1 ;
  43.   METER_TO_HECTOMETER : constant := 0.01 ;
  44.   METER_TO_KILOMETER : constant := 0.001 ;
  45.   METER_TO_MYRIAMETER : constant := 0.0001 ;
  46.   METER_TO_MEGAMETER : constant := 1.0E-6 ;
  47.   METER_TO_GIGAMETER : constant := 1.0E-9 ;
  48.  
  49. --
  50. -- mass
  51. --
  52.   KILOGRAM_TO_POUND : constant := 2.204622341 ;  -- avdp Avoirdupois
  53.   KILOGRAM_TO_GRAIN : constant := 1.0 / 0.0648E-3 ;  -- all systems
  54.   KILOGRAM_TO_CARAT : constant := 5000.0 ;  -- exact
  55.   POUND_TO_KILOGRAM : constant := 1.0 / KILOGRAM_TO_POUND ;
  56.   POUND_TO_POUND_TROY : constant := 7000.0 / 5760.0 ;  -- Troy or Apothecary
  57.   POUND_TO_HUNDREDWEIGHT : constant := 0.01 ;  -- avdp
  58.   POUND_TO_STONE : constant := 112.0 ;
  59.   POUND_TO_TON_SHORT : constant := 1.0 / 2000.0 ;  -- avdp
  60.   POUND_TO_TON_LONG : constant := 1.0 / 2240.0 ;  -- avdp
  61.   DRAM_TO_GRAM : constant := 1.772 ;
  62.   POUND_TO_OUNCE : constant := 16.0 ;  -- avdp
  63.   POUND_TO_DRAM : constant := 256.0 ;  -- avdp , ounce is 16 drams
  64.   POUND_TO_GRAIN : constant := 7000.0 ;  -- avdp
  65.   POUND_TROY_TO_GRAIN : constant := 5700.0 ;  -- CHECK. A GRAIN IS A GRAIN
  66.   POUND_TROY_TO_PENNYWEIGHT : constant := 240.0 ;  -- troy
  67.   POUND_TROY_TO_CARAT : constant := 5760.0 / 3.086 ;  -- troy (exact metric)
  68.   POUND_TROY_TO_OUNCE_TROY : constant := 12.0 ;
  69.   POUND_TROY_TO_DRAM : constant := 8.0 * 16.0 ;  -- apoth
  70.   POUND_TROY_TO_SCRUPLE : constant := 24.0 * 12.0 ;  -- apoth
  71.   KILOGRAM_TO_MILLIGRAM : constant := 1.0E6 ;
  72.   KILOGRAM_TO_GRAM : constant := 1000.0 ;
  73.   KILOGRAM_TO_TON_METRIC : constant := 0.001 ;
  74.  
  75. --
  76. -- time
  77. --
  78.   SECOND_TO_PICOSECOND : constant := 1.0E12 ;
  79.   SECOND_TO_NANOSECOND : constant := 1.0E9 ;
  80.   SECOND_TO_MICROSECOND : constant := 1.0E6 ;
  81.   SECOND_TO_MILLISECOND : constant := 1000.0 ;
  82.   SECOND_TO_CENTISECOND : constant := 100.0 ;
  83.   SECOND_TO_KILOSECOND : constant := 1.0E-3 ;
  84.   SECOND_TO_MEGASECOND : constant := 1.0E-6 ;
  85.   SECOND_TO_GIGASECOND : constant := 1.0E-9 ;
  86.   SECOND_TO_MINUTE : constant := 1.0 / 60.0 ;
  87.   SECOND_TO_HOUR : constant := SECOND_TO_MINUTE / 60.0 ;
  88.   SECOND_TO_DAY : constant := SECOND_TO_HOUR / 24.0 ;
  89.   SECOND_TO_FORTNIGHT : constant := SECOND_TO_DAY / 14.0 ;
  90.   SECOND_TO_YEAR : constant := SECOND_TO_DAY / 365.241 ;
  91.   SECOND_TO_MONTH : constant := SECOND_TO_YEAR * 12.0 ;
  92.   SECOND_TO_DECADE : constant := SECOND_TO_YEAR / 10.0 ;
  93.   SECOND_TO_CENTURY : constant := SECOND_TO_YEAR / 100.0 ;
  94.   SECOND_TO_MILLENNIA : constant := SECOND_TO_YEAR / 1000.0 ;
  95.  
  96. --
  97. -- electric charge, electric flux
  98. --
  99.   COULOMB_TO_AMPERE_SECOND : constant := 1.0 ;  -- definition
  100.   COULOMB_TO_ABCOULOMB : constant := 0.1 ;  -- cgs emu
  101.   COULOMB_TO_STSTCOULOMB : constant := 10.0 * C ;  -- cgs esu
  102.   AMPERE_SECOND_TO_AMPERE_HOURS : constant := 1.0 / 3600.0 ;
  103.   AMPERE_SECOND_TO_ELECTRON : constant := 1.0 / 1.60193E-19 ;
  104.   AMPERE_SECOND_TO_FARADAY : constant := 1.0365E-5 ;
  105.  
  106. --
  107. -- luminous intensity, the flux emitted by 1 candel is 4 Pi lumens
  108. --
  109.   CANDLE_TO_CANDEL : constant := 1.0 ;  -- see LUX, LUMEN, PHOT
  110.  
  111. --
  112. -- temperature ( built into equations )
  113. --
  114.   CENTIGRADE_TO_CELSIOUS : constant := 1.0 ;
  115.  
  116. --
  117. -- angle
  118. --
  119.   DEGREE_TO_RADIAN : constant := 0.0174533 ;
  120.   RADIAN_TO_DEGREE : constant := 57.295780 ;
  121.   RADIAN_TO_MINUTE : constant := RADIAN_TO_DEGREE * 60.0 ;
  122.   RADIAN_TO_SECOND : constant := RADIAN_TO_MINUTE * 60.0 ;
  123.   RADIAN_TO_REVOLUTION : constant := 1.0 / ( 2.0 * PI ) ;
  124.   RADIAN_TO_BAM : constant := 1.0 / PI ;
  125.  
  126. --
  127. -- solid angle
  128. --
  129.   STERADIAN_TO_AREA_OF_SPHERE : constant := 1.0 / ( 4.0 * PI ) ;
  130.  
  131. --
  132. -- area
  133. --
  134.   SQUARE_METER_TO_SQUARE_FOOT : constant := METER_TO_FOOT * METER_TO_FOOT ;
  135.   SQUARE_FOOT_TO_SQUARE_METER : constant := FOOT_TO_METER * FOOT_TO_METER ;
  136.  
  137. --
  138. -- volume
  139. --
  140.   CUBIC_METER_TO_CUBIC_FOOT : constant := SQUARE_METER_TO_SQUARE_FOOT *
  141.       METER_TO_FOOT ;
  142.   CUBIC_FOOT_TO_CUBIC_METER : constant := SQUARE_FOOT_TO_SQUARE_METER *
  143.       FOOT_TO_METER ;
  144.  
  145. --
  146. -- velocity
  147. --
  148.   METER_PER_SECOND_TO_FOOT_PER_SECOND : constant := METER_TO_FOOT ;
  149.  
  150. --
  151. -- angular velocity
  152. --
  153.   RADIAN_PER_SECOND_TO_DEGREE_PER_SECOND : constant := RADIAN_TO_DEGREE ;
  154.  
  155. --
  156. -- acceleration
  157. --
  158.   METER_PER_SECOND_SQUARED_TO_FOOT_PER_SECOND_SQUARED : constant :=
  159.       METER_TO_FOOT ;
  160.  
  161. --
  162. -- angular acceleration
  163. --
  164.   RADIAN_PER_SECOND_SQUARED_TO_DEGREE_PER_SECOND_SQUARED : constant :=
  165.       RADIAN_TO_DEGREE ;
  166.  
  167. --
  168. -- force
  169. --
  170.   POUNDS_TO_POUNDALS : constant := 32.1725 ;
  171.   NEWTON_TO_DYNE : constant := 1.0E5 ;  -- cgs
  172.   NEWTON_TO_POUND : constant := KILOGRAM_TO_POUND * METER_TO_FOOT ;
  173.   NEWTON_TO_POUNDAL : constant := 7.23300 ;
  174.  
  175. --
  176. -- energy, work, heat, torque ( moment )
  177. --
  178.   JOULE_TO_ERG : constant := 1.0E7 ;  -- cgs
  179.  
  180. --
  181. -- power
  182. --
  183.   WATT_TO_ERG_PER_SECOND : constant := 1.0E7 ;  -- cgs
  184.  
  185. --
  186. -- density
  187. --
  188.   KILOGRAM_PER_CUBIC_METER_TO_POUND_PER_CUBIC_FOOT : constant :=
  189.       KILOGRAM_TO_POUND / CUBIC_METER_TO_CUBIC_FOOT ;
  190.  
  191. --
  192. -- flow rate
  193. --
  194.   CUBIC_METER_PER_SECOND_TO_CUBIC_FOOT_PER_SECOND : constant :=
  195.       CUBIC_METER_TO_CUBIC_FOOT ;
  196.  
  197. --
  198. -- pressure, stress, energy density
  199. --
  200.   PASCAL_TO_NEWTON_PER_SQUARE_METER : constant := 1.0 ;
  201.   PASCAL_TO_POUND_PER_SQUARE_FOOT : constant := NEWTON_TO_POUND /
  202.       SQUARE_METER_TO_SQUARE_FOOT ;
  203.  
  204. --
  205. -- momentum
  206. --
  207.   NEWTON_SECOND_TO_POUND_SECOND : constant := NEWTON_TO_POUND ;
  208.  
  209. --
  210. -- inertia
  211. --
  212.   JOULE_SECOND_TO_POUND_SQUARE_FOOT_PER_SECOND : constant := KILOGRAM_TO_POUND
  213.       * SQUARE_METER_TO_SQUARE_FOOT ;
  214.  
  215. --
  216. -- moment of inertia
  217. --
  218.   KILOGRAM_SQUARE_METER_TO_POUND_SQUARE_FOOT : constant := KILOGRAM_TO_POUND *
  219.       SQUARE_METER_TO_SQUARE_FOOT ;
  220.  
  221. --
  222. -- kinematic viscosity
  223. --
  224.   KILOGRAM_SQUARED_PER_SECOND_TO_POUND_SQUARED_PER_SECOND : constant :=
  225.       KILOGRAM_TO_POUND * KILOGRAM_TO_POUND ;
  226.  
  227. --
  228. -- viscosity, dynamic viscosity
  229. --
  230.   KILOGRAM_PER_METER_SECOND_TO_POUND_PER_FOOT_SECOND : constant :=
  231.       KILOGRAM_TO_POUND / METER_TO_FOOT ;
  232.  
  233. --
  234. -- luminous flux
  235. --
  236.   LUMEN_TO_LUMEN : constant := 1.0 ;
  237.  
  238. --
  239. -- illumination
  240. --
  241.   LUMEN_PER_SQUARE_METER_TO_LUX : constant := 1.0 ;  -- metre candle
  242.   LUMEN_PER_SQUARE_METER_TO_FOOT_CANDLE : constant := 10.76 ;  -- lumen/ sq ft
  243.   LUMEN_PER_SQUARE_METER_TO_PHOT : constant := 1.0E4 ;  -- cm candle
  244.  
  245. --
  246. -- luminance
  247. --
  248.   CANDEL_PER_SQUARE_METER_TO_LUX : constant := 1.0 ;
  249.  
  250. --
  251. -- entropy
  252. --
  253.   JOULE_PER_DEGREE_KELVIN_TO_B_T_U_PER_POUND_DEGREE_FARENHEIT : constant :=
  254.       999999999.99999999999 ;  -- ?
  255.  
  256. --
  257. -- electric current, magnetomotive force, I
  258. --
  259.   AMPERE_TO_ABAMPERE : constant := 0.1 ;  -- cgs emu
  260.   AMPERE_TO_STATAMPERE : constant := 10.0 * C ;  -- cgs esu
  261.   AMPERE_TO_GILBERT : constant := 4.0 * PI / 10.0 ;
  262.   AMPERE_TO_AMPERE_TURN : constant := 1.0 ;
  263.  
  264. --
  265. -- voltage, potential difference, electromotive force ( emf ), E
  266. --
  267.   VOLT_TO_ABVOLT : constant := 1.0E8 ;  -- cgs emu
  268.   VOLT_TO_STSTVOLT : constant := 1.0E6 * C ;
  269.  
  270. --
  271. -- electric resistance, R
  272. --
  273.   OHM_TO_ABOHM : constant := 1.0E9 ;  -- cgs emu
  274.   OHM_TO_STATOHM : constant := 1.0E5 * C * C ;  -- cgs esu
  275.  
  276. --
  277. -- electric resistivity
  278. --
  279.   OHM_METER_TO_ABOHM_CENTIMETER : constant := 1.0E11 ;
  280.  
  281. --
  282. -- electric conductance, G
  283. --
  284.   MHO_TO_ABMHO : constant := 1.0E-9 ;  -- cgs emu
  285.  
  286. --
  287. -- electric conductivity
  288. --
  289.   MHO_PER_METER_TO_ABMHO_PER_CENTIMETER : constant := 1.0E-11 ;  -- cgs emu
  290.  
  291. --
  292. -- capacitance, C
  293. --
  294.   FARAD_TO_ABFARAD : constant := 1.0E-9 ;  -- cgs emu
  295.   FARAD_TO_STATFARAD : constant := 1.0E-5 * C * C ;  -- cgs esu
  296.   FARAD_TO_MICROFARAD : constant := 1.0E6 ;
  297.   FARAD_TO_PICOFARAD : constant := 1.0E12 ;
  298.  
  299. --
  300. -- inductance, L
  301. --
  302.   HENRY_TO_ABHENRY : constant := 1.0E9 ;  -- cgs emu
  303.   HENRY_TO_STATHENRY : constant := 1.0E5 / ( C * C ) ;  -- cgs esu
  304.   HENRY_TO_MILLIHENRY : constant := 1000.0 ;
  305.   HENRY_TO_MICROHENRY : constant := 1.0E6 ;
  306.  
  307. --
  308. -- current density, J
  309. --
  310.   AMPERE_PER_SQUARE_METER : constant := 1.0 ;
  311.  
  312. --
  313. -- charge density
  314. --
  315.   COULOMB_PER_CUBIC_METER : constant := 1.0 ;
  316.  
  317. --
  318. -- magnetic flux, magnetic pole
  319. --
  320.   WEBER_TO_MAXWELL : constant := 1.0E8 ;  -- cgs
  321.   WEBER_TO_VOLT_SECOND : constant := 1.0 ;
  322.   WEBER_TO_POLE : constant := 1.0E8 / ( 4.0 * PI ) ;  -- cgs
  323.  
  324. --
  325. -- magnetic flux density, magnetic induction, B
  326. --
  327.   TESLA_TO_WEBER_PER_SQUARE_METER : constant := 1.0 ;
  328.   TESLA_TO_GAUSS : constant := 1.0E4 ;  -- cgs
  329.  
  330. --
  331. -- magnetic intensity, magnetic field strength, H
  332. --
  333.   AMPERE_PER_METER_TO_OERSTED : constant := 0.01 * 4.0 * PI ;
  334.   AMPERE_PER_METER_TO_NEWTON_PER_WEBER : constant := 1.0 ;
  335.  
  336. --
  337. -- magnetic vector potential, A
  338. --
  339.   WEBER_PER_METER : constant := 1.0 ;
  340.  
  341. --
  342. -- electric fiels strength, electric field intensity, E
  343. --
  344.   VOLT_PER_METER_TO_NEWTON_PER_COULOMB : constant := 1.0 ;
  345.  
  346. --
  347. -- electric displacement, D
  348. --
  349.   ELECTRIC_DISPLACEMENT_TO_COULOMB_PER_SQUARE_METER : constant := 1.0 ;
  350.  
  351. --
  352. -- permeability
  353. --
  354.   PERMEABILITY_TO_HENRY_PER_METER : constant := 1.0 ;
  355.  
  356. --
  357. -- permittivity, dielectric constant
  358. --
  359.   PERMITTIVITY_TO_FARAD_PER_METER : constant := 1.0 ;
  360.  
  361. --
  362. -- frequency
  363. --
  364.   HERTZ_TO_KILOHERTZ : constant := 1.0E-3 ;
  365.   HERTZ_TO_MEGAHERTZ : constant := 1.0E-6 ;
  366.   HERTZ_TO_GIGAHERTZ : constant := 1.0E-9 ;
  367.   HERTZ_TO_RADIAN_PER_SECOND : constant := 1.0 / ( 2.0 * PI ) ;
  368.  
  369. --
  370. -- angular frequency, omega = 2 Pi f
  371. --
  372.   RADIAN_PER_SECOND_TO_HERTZ : constant := 2.0 * PI ;
  373.  
  374. --
  375. end PHYSICAL_CONVERSION_CONSTANT ;
  376.