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.
16
* @package Zend_Measure
17
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
18
* @license http://framework.zend.com/license/new-bsd New BSD License
19
* @version $Id: Torque.php 9508 2008-05-23 10:56:41Z thomas $
23
* Implement needed classes
25
require_once 'Zend/Measure/Exception.php';
26
require_once 'Zend/Measure/Abstract.php';
27
require_once 'Zend/Locale.php';
30
* Class for handling torque conversions
33
* @package Zend_Measure
34
* @subpackage Zend_Measure_Torque
35
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
36
* @license http://framework.zend.com/license/new-bsd New BSD License
38
class Zend_Measure_Torque extends Zend_Measure_Abstract
40
const STANDARD = 'NEWTON_METER';
42
const DYNE_CENTIMETER = 'DYNE_CENTIMETER';
43
const GRAM_CENTIMETER = 'GRAM_CENTIMETER';
44
const KILOGRAM_CENTIMETER = 'KILOGRAM_CENTIMETER';
45
const KILOGRAM_METER = 'KILOGRAM_METER';
46
const KILONEWTON_METER = 'KILONEWTON_METER';
47
const KILOPOND_METER = 'KILOPOND_METER';
48
const MEGANEWTON_METER = 'MEGANEWTON_METER';
49
const MICRONEWTON_METER = 'MICRONEWTON_METER';
50
const MILLINEWTON_METER = 'MILLINEWTON_METER';
51
const NEWTON_CENTIMETER = 'NEWTON_CENTIMETER';
52
const NEWTON_METER = 'NEWTON_METER';
53
const OUNCE_FOOT = 'OUNCE_FOOT';
54
const OUNCE_INCH = 'OUNCE_INCH';
55
const POUND_FOOT = 'POUND_FOOT';
56
const POUNDAL_FOOT = 'POUNDAL_FOOT';
57
const POUND_INCH = 'POUND_INCH';
60
* Calculations for all torque units
64
protected $_units = array(
65
'DYNE_CENTIMETER' => array('0.0000001', 'dyncm'),
66
'GRAM_CENTIMETER' => array('0.0000980665', 'gcm'),
67
'KILOGRAM_CENTIMETER' => array('0.0980665', 'kgcm'),
68
'KILOGRAM_METER' => array('9.80665', 'kgm'),
69
'KILONEWTON_METER' => array('1000', 'kNm'),
70
'KILOPOND_METER' => array('9.80665', 'kpm'),
71
'MEGANEWTON_METER' => array('1000000', 'MNm'),
72
'MICRONEWTON_METER' => array('0.000001', 'µNm'),
73
'MILLINEWTON_METER' => array('0.001', 'mNm'),
74
'NEWTON_CENTIMETER' => array('0.01', 'Ncm'),
75
'NEWTON_METER' => array('1', 'Nm'),
76
'OUNCE_FOOT' => array('0.084738622', 'ozft'),
77
'OUNCE_INCH' => array(array('' => '0.084738622', '/' => '12'), 'ozin'),
78
'POUND_FOOT' => array(array('' => '0.084738622', '*' => '16'), 'lbft'),
79
'POUNDAL_FOOT' => array('0.0421401099752144', 'plft'),
80
'POUND_INCH' => array(array('' => '0.084738622', '/' => '12', '*' => '16'), 'lbin'),
81
'STANDARD' => 'NEWTON_METER'