File indexing completed on 2024-12-22 05:36:52

0001 <?php
0002 /**
0003  * Zend Framework
0004  *
0005  * LICENSE
0006  *
0007  * This source file is subject to the new BSD license that is bundled
0008  * with this package in the file LICENSE.txt.
0009  * It is also available through the world-wide-web at this URL:
0010  * http://framework.zend.com/license/new-bsd
0011  * If you did not receive a copy of the license and are unable to
0012  * obtain it through the world-wide-web, please send an email
0013  * to license@zend.com so we can send you a copy immediately.
0014  *
0015  * @category  Zend
0016  * @package   Zend_Measure
0017  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
0018  * @license   http://framework.zend.com/license/new-bsd     New BSD License
0019  * @version   $Id$
0020  */
0021 
0022 /**
0023  * Implement needed classes
0024  */
0025 // require_once 'Zend/Measure/Abstract.php';
0026 // require_once 'Zend/Locale.php';
0027 
0028 /**
0029  * Class for handling torque conversions
0030  *
0031  * @category   Zend
0032  * @package    Zend_Measure
0033  * @subpackage Zend_Measure_Torque
0034  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
0035  * @license    http://framework.zend.com/license/new-bsd     New BSD License
0036  */
0037 class Zend_Measure_Torque extends Zend_Measure_Abstract
0038 {
0039     const STANDARD = 'NEWTON_METER';
0040 
0041     const DYNE_CENTIMETER     = 'DYNE_CENTIMETER';
0042     const GRAM_CENTIMETER     = 'GRAM_CENTIMETER';
0043     const KILOGRAM_CENTIMETER = 'KILOGRAM_CENTIMETER';
0044     const KILOGRAM_METER      = 'KILOGRAM_METER';
0045     const KILONEWTON_METER    = 'KILONEWTON_METER';
0046     const KILOPOND_METER      = 'KILOPOND_METER';
0047     const MEGANEWTON_METER    = 'MEGANEWTON_METER';
0048     const MICRONEWTON_METER   = 'MICRONEWTON_METER';
0049     const MILLINEWTON_METER   = 'MILLINEWTON_METER';
0050     const NEWTON_CENTIMETER   = 'NEWTON_CENTIMETER';
0051     const NEWTON_METER        = 'NEWTON_METER';
0052     const OUNCE_FOOT          = 'OUNCE_FOOT';
0053     const OUNCE_INCH          = 'OUNCE_INCH';
0054     const POUND_FOOT          = 'POUND_FOOT';
0055     const POUNDAL_FOOT        = 'POUNDAL_FOOT';
0056     const POUND_INCH          = 'POUND_INCH';
0057 
0058     /**
0059      * Calculations for all torque units
0060      *
0061      * @var array
0062      */
0063     protected $_units = array(
0064         'DYNE_CENTIMETER'     => array('0.0000001',          'dyncm'),
0065         'GRAM_CENTIMETER'     => array('0.0000980665',       'gcm'),
0066         'KILOGRAM_CENTIMETER' => array('0.0980665',          'kgcm'),
0067         'KILOGRAM_METER'      => array('9.80665',            'kgm'),
0068         'KILONEWTON_METER'    => array('1000',               'kNm'),
0069         'KILOPOND_METER'      => array('9.80665',            'kpm'),
0070         'MEGANEWTON_METER'    => array('1000000',            'MNm'),
0071         'MICRONEWTON_METER'   => array('0.000001',           'µNm'),
0072         'MILLINEWTON_METER'   => array('0.001',              'mNm'),
0073         'NEWTON_CENTIMETER'   => array('0.01',               'Ncm'),
0074         'NEWTON_METER'        => array('1',                  'Nm'),
0075         'OUNCE_FOOT'          => array('0.084738622',        'ozft'),
0076         'OUNCE_INCH'          => array(array('' => '0.084738622', '/' => '12'), 'ozin'),
0077         'POUND_FOOT'          => array(array('' => '0.084738622', '*' => '16'), 'lbft'),
0078         'POUNDAL_FOOT'        => array('0.0421401099752144', 'plft'),
0079         'POUND_INCH'          => array(array('' => '0.084738622', '/' => '12', '*' => '16'), 'lbin'),
0080         'STANDARD'            => 'NEWTON_METER'
0081     );
0082 }