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 pressure conversions
0030  *
0031  * @category   Zend
0032  * @package    Zend_Measure
0033  * @subpackage Zend_Measure_Pressure
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_Pressure extends Zend_Measure_Abstract
0038 {
0039     const STANDARD = 'NEWTON_PER_SQUARE_METER';
0040 
0041     const ATMOSPHERE                           = 'ATMOSPHERE';
0042     const ATMOSPHERE_TECHNICAL                 = 'ATMOSPHERE_TECHNICAL';
0043     const ATTOBAR                              = 'ATTOBAR';
0044     const ATTOPASCAL                           = 'ATTOPASCAL';
0045     const BAR                                  = 'BAR';
0046     const BARAD                                = 'BARAD';
0047     const BARYE                                = 'BARYE';
0048     const CENTIBAR                             = 'CENTIBAR';
0049     const CENTIHG                              = 'CENTIHG';
0050     const CENTIMETER_MERCURY_0C                = 'CENTIMETER_MERCURY_0C';
0051     const CENTIMETER_WATER_4C                  = 'CENTIMETER_WATER_4C';
0052     const CENTIPASCAL                          = 'CENTIPASCAL';
0053     const CENTITORR                            = 'CENTITORR';
0054     const DECIBAR                              = 'DECIBAR';
0055     const DECIPASCAL                           = 'DECIPASCAL';
0056     const DECITORR                             = 'DECITORR';
0057     const DEKABAR                              = 'DEKABAR';
0058     const DEKAPASCAL                           = 'DEKAPASCAL';
0059     const DYNE_PER_SQUARE_CENTIMETER           = 'DYNE_PER_SQUARE_CENTIMETER';
0060     const EXABAR                               = 'EXABAR';
0061     const EXAPASCAL                            = 'EXAPASCAL';
0062     const FEMTOBAR                             = 'FEMTOBAR';
0063     const FEMTOPASCAL                          = 'FEMTOPASCAL';
0064     const FOOT_AIR_0C                          = 'FOOT_AIR_0C';
0065     const FOOT_AIR_15C                         = 'FOOT_AIR_15C';
0066     const FOOT_HEAD                            = 'FOOT_HEAD';
0067     const FOOT_MERCURY_0C                      = 'FOOT_MERCURY_0C';
0068     const FOOT_WATER_4C                        = 'FOOT_WATER_4C';
0069     const GIGABAR                              = 'GIGABAR';
0070     const GIGAPASCAL                           = 'GIGAPASCAL';
0071     const GRAM_FORCE_SQUARE_CENTIMETER         = 'GRAM_FORCE_SQUARE_CENTIMETER';
0072     const HECTOBAR                             = 'HECTOBAR';
0073     const HECTOPASCAL                          = 'HECTOPASCAL';
0074     const INCH_AIR_0C                          = 'INCH_AIR_0C';
0075     const INCH_AIR_15C                         = 'INCH_AIR_15C';
0076     const INCH_MERCURY_0C                      = 'INCH_MERCURY_0C';
0077     const INCH_WATER_4C                        = 'INCH_WATER_4C';
0078     const KILOBAR                              = 'KILOBAR';
0079     const KILOGRAM_FORCE_PER_SQUARE_CENTIMETER = 'KILOGRAM_FORCE_PER_SQUARE_CENTIMETER';
0080     const KILOGRAM_FORCE_PER_SQUARE_METER      = 'KILOGRAM_FORCE_PER_SQUARE_METER';
0081     const KILOGRAM_FORCE_PER_SQUARE_MILLIMETER = 'KILOGRAM_FORCE_PER_SQUARE_MILLIMETER';
0082     const KILONEWTON_PER_SQUARE_METER          = 'KILONEWTON_PER_SQUARE_METER';
0083     const KILOPASCAL                           = 'KILOPASCAL';
0084     const KILOPOND_PER_SQUARE_CENTIMETER       = 'KILOPOND_PER_SQUARE_CENTIMETER';
0085     const KILOPOND_PER_SQUARE_METER            = 'KILOPOND_PER_SQUARE_METER';
0086     const KILOPOND_PER_SQUARE_MILLIMETER       = 'KILOPOND_PER_SQUARE_MILLIMETER';
0087     const KIP_PER_SQUARE_FOOT                  = 'KIP_PER_SQUARE_FOOT';
0088     const KIP_PER_SQUARE_INCH                  = 'KIP_PER_SQUARE_INCH';
0089     const MEGABAR                              = 'MEGABAR';
0090     const MEGANEWTON_PER_SQUARE_METER          = 'MEGANEWTON_PER_SQUARE_METER';
0091     const MEGAPASCAL                           = 'MEGAPASCAL';
0092     const METER_AIR_0C                         = 'METER_AIR_0C';
0093     const METER_AIR_15C                        = 'METER_AIR_15C';
0094     const METER_HEAD                           = 'METER_HEAD';
0095     const MICROBAR                             = 'MICROBAR';
0096     const MICROMETER_MERCURY_0C                = 'MICROMETER_MERCURY_0C';
0097     const MICROMETER_WATER_4C                  = 'MICROMETER_WATER_4C';
0098     const MICRON_MERCURY_0C                    = 'MICRON_MERCURY_0C';
0099     const MICROPASCAL                          = 'MICROPASCAL';
0100     const MILLIBAR                             = 'MILLIBAR';
0101     const MILLIHG                              = 'MILLIHG';
0102     const MILLIMETER_MERCURY_0C                = 'MILLIMETER_MERCURY_0C';
0103     const MILLIMETER_WATER_4C                  = 'MILLIMETER_WATER_4C';
0104     const MILLIPASCAL                          = 'MILLIPASCAL';
0105     const MILLITORR                            = 'MILLITORR';
0106     const NANOBAR                              = 'NANOBAR';
0107     const NANOPASCAL                           = 'NANOPASCAL';
0108     const NEWTON_PER_SQUARE_METER              = 'NEWTON_PER_SQUARE_METER';
0109     const NEWTON_PER_SQUARE_MILLIMETER         = 'NEWTON_PER_SQUARE_MILLIMETER';
0110     const OUNCE_PER_SQUARE_INCH                = 'OUNCE_PER_SQUARE_INCH';
0111     const PASCAL                               = 'PASCAL';
0112     const PETABAR                              = 'PETABAR';
0113     const PETAPASCAL                           = 'PETAPASCAL';
0114     const PICOBAR                              = 'PICOBAR';
0115     const PICOPASCAL                           = 'PICOPASCAL';
0116     const PIEZE                                = 'PIEZE';
0117     const POUND_PER_SQUARE_FOOT                = 'POUND_PER_SQUARE_FOOT';
0118     const POUND_PER_SQUARE_INCH                = 'POUND_PER_SQUARE_INCH';
0119     const POUNDAL_PER_SQUARE_FOOT              = 'POUNDAL_PER_SQUARE_FOOT';
0120     const STHENE_PER_SQUARE_METER              = 'STHENE_PER_SQUARE_METER';
0121     const TECHNICAL_ATMOSPHERE                 = 'TECHNICAL_ATMOSPHERE';
0122     const TERABAR                              = 'TERABAR';
0123     const TERAPASCAL                           = 'TERAPASCAL';
0124     const TON_PER_SQUARE_FOOT                  = 'TON_PER_SQUARE_FOOT';
0125     const TON_PER_SQUARE_FOOT_SHORT            = 'TON_PER_SQUARE_FOOT_SHORT';
0126     const TON_PER_SQUARE_INCH                  = 'TON_PER_SQUARE_INCH';
0127     const TON_PER_SQUARE_INCH_SHORT            = 'TON_PER_SQUARE_INCH_SHORT';
0128     const TON_PER_SQUARE_METER                 = 'TON_PER_SQUARE_METER';
0129     const TORR                                 = 'TORR';
0130     const WATER_COLUMN_CENTIMETER              = 'WATER_COLUMN_CENTIMETER';
0131     const WATER_COLUMN_INCH                    = 'WATER_COLUMN_INCH';
0132     const WATER_COLUMN_MILLIMETER              = 'WATER_COLUMN_MILLIMETER';
0133     const YOCTOBAR                             = 'YOCTOBAR';
0134     const YOCTOPASCAL                          = 'YOCTOPASCAL';
0135     const YOTTABAR                             = 'YOTTABAR';
0136     const YOTTAPASCAL                          = 'YOTTAPASCAL';
0137     const ZEPTOBAR                             = 'ZEPTOBAR';
0138     const ZEPTOPASCAL                          = 'ZEPTOPASCAL';
0139     const ZETTABAR                             = 'ZETTABAR';
0140     const ZETTAPASCAL                          = 'ZETTAPASCAL';
0141 
0142     /**
0143      * Calculations for all pressure units
0144      *
0145      * @var array
0146      */
0147     protected $_units = array(
0148         'ATMOSPHERE'            => array('101325.01', 'atm'),
0149         'ATMOSPHERE_TECHNICAL'  => array('98066.5',   'atm'),
0150         'ATTOBAR'               => array('1.0e-13',   'ab'),
0151         'ATTOPASCAL'            => array('1.0e-18',   'aPa'),
0152         'BAR'                   => array('100000',    'b'),
0153         'BARAD'                 => array('0.1',       'barad'),
0154         'BARYE'                 => array('0.1',       'ba'),
0155         'CENTIBAR'              => array('1000',      'cb'),
0156         'CENTIHG'               => array('1333.2239', 'cHg'),
0157         'CENTIMETER_MERCURY_0C' => array('1333.2239', 'cm mercury (0°C)'),
0158         'CENTIMETER_WATER_4C'   => array('98.0665',   'cm water (4°C)'),
0159         'CENTIPASCAL'           => array('0.01',      'cPa'),
0160         'CENTITORR'             => array('1.3332237', 'cTorr'),
0161         'DECIBAR'               => array('10000',     'db'),
0162         'DECIPASCAL'            => array('0.1',       'dPa'),
0163         'DECITORR'              => array('13.332237', 'dTorr'),
0164         'DEKABAR'               => array('1000000',   'dab'),
0165         'DEKAPASCAL'            => array('10',        'daPa'),
0166         'DYNE_PER_SQUARE_CENTIMETER' => array('0.1',  'dyn/cm²'),
0167         'EXABAR'                => array('1.0e+23',   'Eb'),
0168         'EXAPASCAL'             => array('1.0e+18',   'EPa'),
0169         'FEMTOBAR'              => array('1.0e-10',   'fb'),
0170         'FEMTOPASCAL'           => array('1.0e-15',   'fPa'),
0171         'FOOT_AIR_0C'           => array('3.8640888', 'ft air (0°C)'),
0172         'FOOT_AIR_15C'          => array('3.6622931', 'ft air (15°C)'),
0173         'FOOT_HEAD'             => array('2989.0669', 'ft head'),
0174         'FOOT_MERCURY_0C'       => array('40636.664', 'ft mercury (0°C)'),
0175         'FOOT_WATER_4C'         => array('2989.0669', 'ft water (4°C)'),
0176         'GIGABAR'               => array('1.0e+14',   'Gb'),
0177         'GIGAPASCAL'            => array('1.0e+9',    'GPa'),
0178         'GRAM_FORCE_SQUARE_CENTIMETER' => array('98.0665', 'gf'),
0179         'HECTOBAR'              => array('1.0e+7',    'hb'),
0180         'HECTOPASCAL'           => array('100',       'hPa'),
0181         'INCH_AIR_0C'           => array(array('' => '3.8640888', '/' => '12'), 'in air (0°C)'),
0182         'INCH_AIR_15C'          => array(array('' => '3.6622931', '/' => '12'), 'in air (15°C)'),
0183         'INCH_MERCURY_0C'       => array(array('' => '40636.664', '/' => '12'), 'in mercury (0°C)'),
0184         'INCH_WATER_4C'         => array(array('' => '2989.0669', '/' => '12'), 'in water (4°C)'),
0185         'KILOBAR'               => array('1.0e+8',    'kb'),
0186         'KILOGRAM_FORCE_PER_SQUARE_CENTIMETER' => array('98066.5', 'kgf/cm²'),
0187         'KILOGRAM_FORCE_PER_SQUARE_METER'      => array('9.80665', 'kgf/m²'),
0188         'KILOGRAM_FORCE_PER_SQUARE_MILLIMETER' => array('9806650', 'kgf/mm²'),
0189         'KILONEWTON_PER_SQUARE_METER'          => array('1000',    'kN/m²'),
0190         'KILOPASCAL'            => array('1000',      'kPa'),
0191         'KILOPOND_PER_SQUARE_CENTIMETER' => array('98066.5', 'kp/cm²'),
0192         'KILOPOND_PER_SQUARE_METER'      => array('9.80665', 'kp/m²'),
0193         'KILOPOND_PER_SQUARE_MILLIMETER' => array('9806650', 'kp/mm²'),
0194         'KIP_PER_SQUARE_FOOT'   => array(array('' => '430.92233', '/' => '0.009'),   'kip/ft²'),
0195         'KIP_PER_SQUARE_INCH'   => array(array('' => '62052.81552', '/' => '0.009'), 'kip/in²'),
0196         'MEGABAR'               => array('1.0e+11',    'Mb'),
0197         'MEGANEWTON_PER_SQUARE_METER' => array('1000000', 'MN/m²'),
0198         'MEGAPASCAL'            => array('1000000',    'MPa'),
0199         'METER_AIR_0C'          => array('12.677457',  'm air (0°C)'),
0200         'METER_AIR_15C'         => array('12.015397',  'm air (15°C)'),
0201         'METER_HEAD'            => array('9804.139432', 'm head'),
0202         'MICROBAR'              => array('0.1',        'µb'),
0203         'MICROMETER_MERCURY_0C' => array('0.13332239', 'µm mercury (0°C)'),
0204         'MICROMETER_WATER_4C'   => array('0.00980665', 'µm water (4°C)'),
0205         'MICRON_MERCURY_0C'     => array('0.13332239', 'µ mercury (0°C)'),
0206         'MICROPASCAL'           => array('0.000001',   'µPa'),
0207         'MILLIBAR'              => array('100',        'mb'),
0208         'MILLIHG'               => array('133.32239',  'mHg'),
0209         'MILLIMETER_MERCURY_0C' => array('133.32239',  'mm mercury (0°C)'),
0210         'MILLIMETER_WATER_4C'   => array('9.80665',    'mm water (0°C)'),
0211         'MILLIPASCAL'           => array('0.001',      'mPa'),
0212         'MILLITORR'             => array('0.13332237', 'mTorr'),
0213         'NANOBAR'               => array('0.0001',     'nb'),
0214         'NANOPASCAL'            => array('1.0e-9',     'nPa'),
0215         'NEWTON_PER_SQUARE_METER'      => array('1',   'N/m²'),
0216         'NEWTON_PER_SQUARE_MILLIMETER' => array('1000000',   'N/mm²'),
0217         'OUNCE_PER_SQUARE_INCH'        => array('430.92233', 'oz/in²'),
0218         'PASCAL'                => array('1',          'Pa'),
0219         'PETABAR'               => array('1.0e+20',    'Pb'),
0220         'PETAPASCAL'            => array('1.0e+15',    'PPa'),
0221         'PICOBAR'               => array('0.0000001',  'pb'),
0222         'PICOPASCAL'            => array('1.0e-12',    'pPa'),
0223         'PIEZE'                 => array('1000',       'pz'),
0224         'POUND_PER_SQUARE_FOOT' => array(array('' => '430.92233', '/' => '9'), 'lb/ft²'),
0225         'POUND_PER_SQUARE_INCH' => array('6894.75728', 'lb/in²'),
0226         'POUNDAL_PER_SQUARE_FOOT' => array('1.4881639', 'pdl/ft²'),
0227         'STHENE_PER_SQUARE_METER' => array('1000',     'sn/m²'),
0228         'TECHNICAL_ATMOSPHERE'  => array('98066.5',    'at'),
0229         'TERABAR'               => array('1.0e+17',    'Tb'),
0230         'TERAPASCAL'            => array('1.0e+12',    'TPa'),
0231         'TON_PER_SQUARE_FOOT'   => array(array('' => '120658.2524', '/' => '1.125'),      't/ft²'),
0232         'TON_PER_SQUARE_FOOT_SHORT' => array(array('' => '430.92233', '/' => '0.0045'),   't/ft²'),
0233         'TON_PER_SQUARE_INCH'   => array(array('' => '17374788.3456', '/' => '1.125'),    't/in²'),
0234         'TON_PER_SQUARE_INCH_SHORT' => array(array('' => '62052.81552', '/' => '0.0045'), 't/in²'),
0235         'TON_PER_SQUARE_METER'  => array('9806.65',    't/m²'),
0236         'TORR'                  => array('133.32237',  'Torr'),
0237         'WATER_COLUMN_CENTIMETER' => array('98.0665',  'WC (cm)'),
0238         'WATER_COLUMN_INCH'       => array(array('' => '2989.0669', '/' => '12'), 'WC (in)'),
0239         'WATER_COLUMN_MILLIMETER' => array('9.80665',  'WC (mm)'),
0240         'YOCTOBAR'              => array('1.0e-19',    'yb'),
0241         'YOCTOPASCAL'           => array('1.0e-24',    'yPa'),
0242         'YOTTABAR'              => array('1.0e+29',    'Yb'),
0243         'YOTTAPASCAL'           => array('1.0e+24',    'YPa'),
0244         'ZEPTOBAR'              => array('1.0e-16',    'zb'),
0245         'ZEPTOPASCAL'           => array('1.0e-21',    'zPa'),
0246         'ZETTABAR'              => array('1.0e+26',    'Zb'),
0247         'ZETTAPASCAL'           => array('1.0e+21',    'ZPa'),
0248         'STANDARD'              => 'NEWTON_PER_SQUARE_METER'
0249     );
0250 }