Torque.php 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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 torque conversions
  28. *
  29. * @category Zend
  30. * @package Zend_Measure
  31. * @subpackage Zend_Measure_Torque
  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_Torque extends Zend_Measure_Abstract
  36. {
  37. const STANDARD = 'NEWTON_METER';
  38. const DYNE_CENTIMETER = 'DYNE_CENTIMETER';
  39. const GRAM_CENTIMETER = 'GRAM_CENTIMETER';
  40. const KILOGRAM_CENTIMETER = 'KILOGRAM_CENTIMETER';
  41. const KILOGRAM_METER = 'KILOGRAM_METER';
  42. const KILONEWTON_METER = 'KILONEWTON_METER';
  43. const KILOPOND_METER = 'KILOPOND_METER';
  44. const MEGANEWTON_METER = 'MEGANEWTON_METER';
  45. const MICRONEWTON_METER = 'MICRONEWTON_METER';
  46. const MILLINEWTON_METER = 'MILLINEWTON_METER';
  47. const NEWTON_CENTIMETER = 'NEWTON_CENTIMETER';
  48. const NEWTON_METER = 'NEWTON_METER';
  49. const OUNCE_FOOT = 'OUNCE_FOOT';
  50. const OUNCE_INCH = 'OUNCE_INCH';
  51. const POUND_FOOT = 'POUND_FOOT';
  52. const POUNDAL_FOOT = 'POUNDAL_FOOT';
  53. const POUND_INCH = 'POUND_INCH';
  54. /**
  55. * Calculations for all torque units
  56. *
  57. * @var array
  58. */
  59. protected $_units = array(
  60. 'DYNE_CENTIMETER' => array('0.0000001', 'dyncm'),
  61. 'GRAM_CENTIMETER' => array('0.0000980665', 'gcm'),
  62. 'KILOGRAM_CENTIMETER' => array('0.0980665', 'kgcm'),
  63. 'KILOGRAM_METER' => array('9.80665', 'kgm'),
  64. 'KILONEWTON_METER' => array('1000', 'kNm'),
  65. 'KILOPOND_METER' => array('9.80665', 'kpm'),
  66. 'MEGANEWTON_METER' => array('1000000', 'MNm'),
  67. 'MICRONEWTON_METER' => array('0.000001', 'µNm'),
  68. 'MILLINEWTON_METER' => array('0.001', 'mNm'),
  69. 'NEWTON_CENTIMETER' => array('0.01', 'Ncm'),
  70. 'NEWTON_METER' => array('1', 'Nm'),
  71. 'OUNCE_FOOT' => array('0.084738622', 'ozft'),
  72. 'OUNCE_INCH' => array(array('' => '0.084738622', '/' => '12'), 'ozin'),
  73. 'POUND_FOOT' => array(array('' => '0.084738622', '*' => '16'), 'lbft'),
  74. 'POUNDAL_FOOT' => array('0.0421401099752144', 'plft'),
  75. 'POUND_INCH' => array(array('' => '0.084738622', '/' => '12', '*' => '16'), 'lbin'),
  76. 'STANDARD' => 'NEWTON_METER'
  77. );
  78. }