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-2009 Zend Technologies USA Inc. (http://www.zend.com)
18 * @license http://framework.zend.com/license/new-bsd New BSD License
23 * Implement needed classes
25 require_once 'Zend/Measure/Abstract.php';
26 require_once 'Zend/Locale.php';
29 * Class for handling pressure conversions
32 * @package Zend_Measure
33 * @subpackage Zend_Measure_Pressure
34 * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
35 * @license http://framework.zend.com/license/new-bsd New BSD License
37 class Zend_Measure_Pressure
extends Zend_Measure_Abstract
39 const STANDARD
= 'NEWTON_PER_SQUARE_METER';
41 const ATMOSPHERE
= 'ATMOSPHERE';
42 const ATMOSPHERE_TECHNICAL
= 'ATMOSPHERE_TECHNICAL';
43 const ATTOBAR
= 'ATTOBAR';
44 const ATTOPASCAL
= 'ATTOPASCAL';
46 const BARAD
= 'BARAD';
47 const BARYE
= 'BARYE';
48 const CENTIBAR
= 'CENTIBAR';
49 const CENTIHG
= 'CENTIHG';
50 const CENTIMETER_MERCURY_0C
= 'CENTIMETER_MERCURY_0C';
51 const CENTIMETER_WATER_4C
= 'CENTIMETER_WATER_4C';
52 const CENTIPASCAL
= 'CENTIPASCAL';
53 const CENTITORR
= 'CENTITORR';
54 const DECIBAR
= 'DECIBAR';
55 const DECIPASCAL
= 'DECIPASCAL';
56 const DECITORR
= 'DECITORR';
57 const DEKABAR
= 'DEKABAR';
58 const DEKAPASCAL
= 'DEKAPASCAL';
59 const DYNE_PER_SQUARE_CENTIMETER
= 'DYNE_PER_SQUARE_CENTIMETER';
60 const EXABAR
= 'EXABAR';
61 const EXAPASCAL
= 'EXAPASCAL';
62 const FEMTOBAR
= 'FEMTOBAR';
63 const FEMTOPASCAL
= 'FEMTOPASCAL';
64 const FOOT_AIR_0C
= 'FOOT_AIR_0C';
65 const FOOT_AIR_15C
= 'FOOT_AIR_15C';
66 const FOOT_HEAD
= 'FOOT_HEAD';
67 const FOOT_MERCURY_0C
= 'FOOT_MERCURY_0C';
68 const FOOT_WATER_4C
= 'FOOT_WATER_4C';
69 const GIGABAR
= 'GIGABAR';
70 const GIGAPASCAL
= 'GIGAPASCAL';
71 const GRAM_FORCE_SQUARE_CENTIMETER
= 'GRAM_FORCE_SQUARE_CENTIMETER';
72 const HECTOBAR
= 'HECTOBAR';
73 const HECTOPASCAL
= 'HECTOPASCAL';
74 const INCH_AIR_0C
= 'INCH_AIR_0C';
75 const INCH_AIR_15C
= 'INCH_AIR_15C';
76 const INCH_MERCURY_0C
= 'INCH_MERCURY_0C';
77 const INCH_WATER_4C
= 'INCH_WATER_4C';
78 const KILOBAR
= 'KILOBAR';
79 const KILOGRAM_FORCE_PER_SQUARE_CENTIMETER
= 'KILOGRAM_FORCE_PER_SQUARE_CENTIMETER';
80 const KILOGRAM_FORCE_PER_SQUARE_METER
= 'KILOGRAM_FORCE_PER_SQUARE_METER';
81 const KILOGRAM_FORCE_PER_SQUARE_MILLIMETER
= 'KILOGRAM_FORCE_PER_SQUARE_MILLIMETER';
82 const KILONEWTON_PER_SQUARE_METER
= 'KILONEWTON_PER_SQUARE_METER';
83 const KILOPASCAL
= 'KILOPASCAL';
84 const KILOPOND_PER_SQUARE_CENTIMETER
= 'KILOPOND_PER_SQUARE_CENTIMETER';
85 const KILOPOND_PER_SQUARE_METER
= 'KILOPOND_PER_SQUARE_METER';
86 const KILOPOND_PER_SQUARE_MILLIMETER
= 'KILOPOND_PER_SQUARE_MILLIMETER';
87 const KIP_PER_SQUARE_FOOT
= 'KIP_PER_SQUARE_FOOT';
88 const KIP_PER_SQUARE_INCH
= 'KIP_PER_SQUARE_INCH';
89 const MEGABAR
= 'MEGABAR';
90 const MEGANEWTON_PER_SQUARE_METER
= 'MEGANEWTON_PER_SQUARE_METER';
91 const MEGAPASCAL
= 'MEGAPASCAL';
92 const METER_AIR_0C
= 'METER_AIR_0C';
93 const METER_AIR_15C
= 'METER_AIR_15C';
94 const METER_HEAD
= 'METER_HEAD';
95 const MICROBAR
= 'MICROBAR';
96 const MICROMETER_MERCURY_0C
= 'MICROMETER_MERCURY_0C';
97 const MICROMETER_WATER_4C
= 'MICROMETER_WATER_4C';
98 const MICRON_MERCURY_0C
= 'MICRON_MERCURY_0C';
99 const MICROPASCAL
= 'MICROPASCAL';
100 const MILLIBAR
= 'MILLIBAR';
101 const MILLIHG
= 'MILLIHG';
102 const MILLIMETER_MERCURY_0C
= 'MILLIMETER_MERCURY_0C';
103 const MILLIMETER_WATER_4C
= 'MILLIMETER_WATER_4C';
104 const MILLIPASCAL
= 'MILLIPASCAL';
105 const MILLITORR
= 'MILLITORR';
106 const NANOBAR
= 'NANOBAR';
107 const NANOPASCAL
= 'NANOPASCAL';
108 const NEWTON_PER_SQUARE_METER
= 'NEWTON_PER_SQUARE_METER';
109 const NEWTON_PER_SQUARE_MILLIMETER
= 'NEWTON_PER_SQUARE_MILLIMETER';
110 const OUNCE_PER_SQUARE_INCH
= 'OUNCE_PER_SQUARE_INCH';
111 const PASCAL
= 'PASCAL';
112 const PETABAR
= 'PETABAR';
113 const PETAPASCAL
= 'PETAPASCAL';
114 const PICOBAR
= 'PICOBAR';
115 const PICOPASCAL
= 'PICOPASCAL';
116 const PIEZE
= 'PIEZE';
117 const POUND_PER_SQUARE_FOOT
= 'POUND_PER_SQUARE_FOOT';
118 const POUND_PER_SQUARE_INCH
= 'POUND_PER_SQUARE_INCH';
119 const POUNDAL_PER_SQUARE_FOOT
= 'POUNDAL_PER_SQUARE_FOOT';
120 const STHENE_PER_SQUARE_METER
= 'STHENE_PER_SQUARE_METER';
121 const TECHNICAL_ATMOSPHERE
= 'TECHNICAL_ATMOSPHERE';
122 const TERABAR
= 'TERABAR';
123 const TERAPASCAL
= 'TERAPASCAL';
124 const TON_PER_SQUARE_FOOT
= 'TON_PER_SQUARE_FOOT';
125 const TON_PER_SQUARE_FOOT_SHORT
= 'TON_PER_SQUARE_FOOT_SHORT';
126 const TON_PER_SQUARE_INCH
= 'TON_PER_SQUARE_INCH';
127 const TON_PER_SQUARE_INCH_SHORT
= 'TON_PER_SQUARE_INCH_SHORT';
128 const TON_PER_SQUARE_METER
= 'TON_PER_SQUARE_METER';
130 const WATER_COLUMN_CENTIMETER
= 'WATER_COLUMN_CENTIMETER';
131 const WATER_COLUMN_INCH
= 'WATER_COLUMN_INCH';
132 const WATER_COLUMN_MILLIMETER
= 'WATER_COLUMN_MILLIMETER';
133 const YOCTOBAR
= 'YOCTOBAR';
134 const YOCTOPASCAL
= 'YOCTOPASCAL';
135 const YOTTABAR
= 'YOTTABAR';
136 const YOTTAPASCAL
= 'YOTTAPASCAL';
137 const ZEPTOBAR
= 'ZEPTOBAR';
138 const ZEPTOPASCAL
= 'ZEPTOPASCAL';
139 const ZETTABAR
= 'ZETTABAR';
140 const ZETTAPASCAL
= 'ZETTAPASCAL';
143 * Calculations for all pressure units
147 protected $_units = array(
148 'ATMOSPHERE' => array('101325.01', 'atm'),
149 'ATMOSPHERE_TECHNICAL' => array('98066.5', 'atm'),
150 'ATTOBAR' => array('1.0e-13', 'ab'),
151 'ATTOPASCAL' => array('1.0e-18', 'aPa'),
152 'BAR' => array('100000', 'b'),
153 'BARAD' => array('0.1', 'barad'),
154 'BARYE' => array('0.1', 'ba'),
155 'CENTIBAR' => array('1000', 'cb'),
156 'CENTIHG' => array('1333.2239', 'cHg'),
157 'CENTIMETER_MERCURY_0C' => array('1333.2239', 'cm mercury (0°C)'),
158 'CENTIMETER_WATER_4C' => array('98.0665', 'cm water (4°C)'),
159 'CENTIPASCAL' => array('0.01', 'cPa'),
160 'CENTITORR' => array('1.3332237', 'cTorr'),
161 'DECIBAR' => array('10000', 'db'),
162 'DECIPASCAL' => array('0.1', 'dPa'),
163 'DECITORR' => array('13.332237', 'dTorr'),
164 'DEKABAR' => array('1000000', 'dab'),
165 'DEKAPASCAL' => array('10', 'daPa'),
166 'DYNE_PER_SQUARE_CENTIMETER' => array('0.1', 'dyn/cm²'),
167 'EXABAR' => array('1.0e+23', 'Eb'),
168 'EXAPASCAL' => array('1.0e+18', 'EPa'),
169 'FEMTOBAR' => array('1.0e-10', 'fb'),
170 'FEMTOPASCAL' => array('1.0e-15', 'fPa'),
171 'FOOT_AIR_0C' => array('3.8640888', 'ft air (0°C)'),
172 'FOOT_AIR_15C' => array('3.6622931', 'ft air (15°C)'),
173 'FOOT_HEAD' => array('2989.0669', 'ft head'),
174 'FOOT_MERCURY_0C' => array('40636.664', 'ft mercury (0°C)'),
175 'FOOT_WATER_4C' => array('2989.0669', 'ft water (4°C)'),
176 'GIGABAR' => array('1.0e+14', 'Gb'),
177 'GIGAPASCAL' => array('1.0e+9', 'GPa'),
178 'GRAM_FORCE_SQUARE_CENTIMETER' => array('98.0665', 'gf'),
179 'HECTOBAR' => array('1.0e+7', 'hb'),
180 'HECTOPASCAL' => array('100', 'hPa'),
181 'INCH_AIR_0C' => array(array('' => '3.8640888', '/' => '12'), 'in air (0°C)'),
182 'INCH_AIR_15C' => array(array('' => '3.6622931', '/' => '12'), 'in air (15°C)'),
183 'INCH_MERCURY_0C' => array(array('' => '40636.664', '/' => '12'), 'in mercury (0°C)'),
184 'INCH_WATER_4C' => array(array('' => '2989.0669', '/' => '12'), 'in water (4°C)'),
185 'KILOBAR' => array('1.0e+8', 'kb'),
186 'KILOGRAM_FORCE_PER_SQUARE_CENTIMETER' => array('98066.5', 'kgf/cm²'),
187 'KILOGRAM_FORCE_PER_SQUARE_METER' => array('9.80665', 'kgf/m²'),
188 'KILOGRAM_FORCE_PER_SQUARE_MILLIMETER' => array('9806650', 'kgf/mm²'),
189 'KILONEWTON_PER_SQUARE_METER' => array('1000', 'kN/m²'),
190 'KILOPASCAL' => array('1000', 'kPa'),
191 'KILOPOND_PER_SQUARE_CENTIMETER' => array('98066.5', 'kp/cm²'),
192 'KILOPOND_PER_SQUARE_METER' => array('9.80665', 'kp/m²'),
193 'KILOPOND_PER_SQUARE_MILLIMETER' => array('9806650', 'kp/mm²'),
194 'KIP_PER_SQUARE_FOOT' => array(array('' => '430.92233', '/' => '0.009'), 'kip/ft²'),
195 'KIP_PER_SQUARE_INCH' => array(array('' => '62052.81552', '/' => '0.009'), 'kip/in²'),
196 'MEGABAR' => array('1.0e+11', 'Mb'),
197 'MEGANEWTON_PER_SQUARE_METER' => array('1000000', 'MN/m²'),
198 'MEGAPASCAL' => array('1000000', 'MPa'),
199 'METER_AIR_0C' => array('12.677457', 'm air (0°C)'),
200 'METER_AIR_15C' => array('12.015397', 'm air (15°C)'),
201 'METER_HEAD' => array('9804.139432', 'm head'),
202 'MICROBAR' => array('0.1', 'µb'),
203 'MICROMETER_MERCURY_0C' => array('0.13332239', 'µm mercury (0°C)'),
204 'MICROMETER_WATER_4C' => array('0.00980665', 'µm water (4°C)'),
205 'MICRON_MERCURY_0C' => array('0.13332239', 'µ mercury (0°C)'),
206 'MICROPASCAL' => array('0.000001', 'µPa'),
207 'MILLIBAR' => array('100', 'mb'),
208 'MILLIHG' => array('133.32239', 'mHg'),
209 'MILLIMETER_MERCURY_0C' => array('133.32239', 'mm mercury (0°C)'),
210 'MILLIMETER_WATER_4C' => array('9.80665', 'mm water (0°C)'),
211 'MILLIPASCAL' => array('0.001', 'mPa'),
212 'MILLITORR' => array('0.13332237', 'mTorr'),
213 'NANOBAR' => array('0.0001', 'nb'),
214 'NANOPASCAL' => array('1.0e-9', 'nPa'),
215 'NEWTON_PER_SQUARE_METER' => array('1', 'N/m²'),
216 'NEWTON_PER_SQUARE_MILLIMETER' => array('1000000', 'N/mm²'),
217 'OUNCE_PER_SQUARE_INCH' => array('430.92233', 'oz/in²'),
218 'PASCAL' => array('1', 'Pa'),
219 'PETABAR' => array('1.0e+20', 'Pb'),
220 'PETAPASCAL' => array('1.0e+15', 'PPa'),
221 'PICOBAR' => array('0.0000001', 'pb'),
222 'PICOPASCAL' => array('1.0e-12', 'pPa'),
223 'PIEZE' => array('1000', 'pz'),
224 'POUND_PER_SQUARE_FOOT' => array(array('' => '430.92233', '/' => '9'), 'lb/ft²'),
225 'POUND_PER_SQUARE_INCH' => array('6894.75728', 'lb/in²'),
226 'POUNDAL_PER_SQUARE_FOOT' => array('1.4881639', 'pdl/ft²'),
227 'STHENE_PER_SQUARE_METER' => array('1000', 'sn/m²'),
228 'TECHNICAL_ATMOSPHERE' => array('98066.5', 'at'),
229 'TERABAR' => array('1.0e+17', 'Tb'),
230 'TERAPASCAL' => array('1.0e+12', 'TPa'),
231 'TON_PER_SQUARE_FOOT' => array(array('' => '120658.2524', '/' => '1.125'), 't/ft²'),
232 'TON_PER_SQUARE_FOOT_SHORT' => array(array('' => '430.92233', '/' => '0.0045'), 't/ft²'),
233 'TON_PER_SQUARE_INCH' => array(array('' => '17374788.3456', '/' => '1.125'), 't/in²'),
234 'TON_PER_SQUARE_INCH_SHORT' => array(array('' => '62052.81552', '/' => '0.0045'), 't/in²'),
235 'TON_PER_SQUARE_METER' => array('9806.65', 't/m²'),
236 'TORR' => array('133.32237', 'Torr'),
237 'WATER_COLUMN_CENTIMETER' => array('98.0665', 'WC (cm)'),
238 'WATER_COLUMN_INCH' => array(array('' => '2989.0669', '/' => '12'), 'WC (in)'),
239 'WATER_COLUMN_MILLIMETER' => array('9.80665', 'WC (mm)'),
240 'YOCTOBAR' => array('1.0e-19', 'yb'),
241 'YOCTOPASCAL' => array('1.0e-24', 'yPa'),
242 'YOTTABAR' => array('1.0e+29', 'Yb'),
243 'YOTTAPASCAL' => array('1.0e+24', 'YPa'),
244 'ZEPTOBAR' => array('1.0e-16', 'zb'),
245 'ZEPTOPASCAL' => array('1.0e-21', 'zPa'),
246 'ZETTABAR' => array('1.0e+26', 'Zb'),
247 'ZETTAPASCAL' => array('1.0e+21', 'ZPa'),
248 'STANDARD' => 'NEWTON_PER_SQUARE_METER'