Acceleration.php 4.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <?php
  2. /**
  3. * Zend Framework
  4. *
  5. * LICENSE
  6. *
  7. * This source file is subject to the new BSD license that is bundled
  8. * with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://framework.zend.com/license/new-bsd
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to license@zend.com so we can send you a copy immediately.
  14. *
  15. * @category Zend
  16. * @package Zend_Measure
  17. * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  18. * @license http://framework.zend.com/license/new-bsd New BSD License
  19. * @version $Id$
  20. */
  21. /**
  22. * Implement needed classes
  23. */
  24. #require_once 'Zend/Measure/Abstract.php';
  25. #require_once 'Zend/Locale.php';
  26. /**
  27. * Class for handling acceleration conversions
  28. *
  29. * @category Zend
  30. * @package Zend_Measure
  31. * @subpackage Zend_Measure_Acceleration
  32. * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  33. * @license http://framework.zend.com/license/new-bsd New BSD License
  34. */
  35. class Zend_Measure_Acceleration extends Zend_Measure_Abstract
  36. {
  37. const STANDARD = 'METER_PER_SQUARE_SECOND';
  38. const CENTIGAL = 'CENTIGAL';
  39. const CENTIMETER_PER_SQUARE_SECOND = 'CENTIMETER_PER_SQUARE_SECOND';
  40. const DECIGAL = 'DECIGAL';
  41. const DECIMETER_PER_SQUARE_SECOND = 'DECIMETER_PER_SQUARE_SECOND';
  42. const DEKAMETER_PER_SQUARE_SECOND = 'DEKAMETER_PER_SQUARE_SECOND';
  43. const FOOT_PER_SQUARE_SECOND = 'FOOT_PER_SQUARE_SECOND';
  44. const G = 'G';
  45. const GAL = 'GAL';
  46. const GALILEO = 'GALILEO';
  47. const GRAV = 'GRAV';
  48. const HECTOMETER_PER_SQUARE_SECOND = 'HECTOMETER_PER_SQUARE_SECOND';
  49. const INCH_PER_SQUARE_SECOND = 'INCH_PER_SQUARE_SECOND';
  50. const KILOMETER_PER_HOUR_SECOND = 'KILOMETER_PER_HOUR_SECOND';
  51. const KILOMETER_PER_SQUARE_SECOND = 'KILOMETER_PER_SQUARE_SECOND';
  52. const METER_PER_SQUARE_SECOND = 'METER_PER_SQUARE_SECOND';
  53. const MILE_PER_HOUR_MINUTE = 'MILE_PER_HOUR_MINUTE';
  54. const MILE_PER_HOUR_SECOND = 'MILE_PER_HOUR_SECOND';
  55. const MILE_PER_SQUARE_SECOND = 'MILE_PER_SQUARE_SECOND';
  56. const MILLIGAL = 'MILLIGAL';
  57. const MILLIMETER_PER_SQUARE_SECOND = 'MILLIMETER_PER_SQUARE_SECOND';
  58. /**
  59. * Calculations for all acceleration units
  60. *
  61. * @var array
  62. */
  63. protected $_units = array(
  64. 'CENTIGAL' => array('0.0001', 'cgal'),
  65. 'CENTIMETER_PER_SQUARE_SECOND' => array('0.01', 'cm/s²'),
  66. 'DECIGAL' => array('0.001', 'dgal'),
  67. 'DECIMETER_PER_SQUARE_SECOND' => array('0.1', 'dm/s²'),
  68. 'DEKAMETER_PER_SQUARE_SECOND' => array('10', 'dam/s²'),
  69. 'FOOT_PER_SQUARE_SECOND' => array('0.3048', 'ft/s²'),
  70. 'G' => array('9.80665', 'g'),
  71. 'GAL' => array('0.01', 'gal'),
  72. 'GALILEO' => array('0.01', 'gal'),
  73. 'GRAV' => array('9.80665', 'g'),
  74. 'HECTOMETER_PER_SQUARE_SECOND' => array('100', 'h/s²'),
  75. 'INCH_PER_SQUARE_SECOND' => array('0.0254', 'in/s²'),
  76. 'KILOMETER_PER_HOUR_SECOND' => array(array('' => '5','/' => '18'), 'km/h²'),
  77. 'KILOMETER_PER_SQUARE_SECOND' => array('1000', 'km/s²'),
  78. 'METER_PER_SQUARE_SECOND' => array('1', 'm/s²'),
  79. 'MILE_PER_HOUR_MINUTE' => array(array('' => '22', '/' => '15', '*' => '0.3048', '/' => '60'), 'mph/m'),
  80. 'MILE_PER_HOUR_SECOND' => array(array('' => '22', '/' => '15', '*' => '0.3048'), 'mph/s'),
  81. 'MILE_PER_SQUARE_SECOND' => array('1609.344', 'mi/s²'),
  82. 'MILLIGAL' => array('0.00001', 'mgal'),
  83. 'MILLIMETER_PER_SQUARE_SECOND' => array('0.001', 'mm/s²'),
  84. 'STANDARD' => 'METER_PER_SQUARE_SECOND'
  85. );
  86. }