File indexing completed on 2024-05-12 06:02:47

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 /**
0024  * Implement needed classes
0025  */
0026 // require_once 'Zend/Measure/Abstract.php';
0027 // require_once 'Zend/Locale.php';
0028 
0029 /**
0030  * Class for handling acceleration conversions
0031  *
0032  * @category   Zend
0033  * @package    Zend_Measure
0034  * @subpackage Zend_Measure_Acceleration
0035  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
0036  * @license    http://framework.zend.com/license/new-bsd     New BSD License
0037  */
0038 class Zend_Measure_Acceleration extends Zend_Measure_Abstract
0039 {
0040     const STANDARD = 'METER_PER_SQUARE_SECOND';
0041 
0042     const CENTIGAL                     = 'CENTIGAL';
0043     const CENTIMETER_PER_SQUARE_SECOND = 'CENTIMETER_PER_SQUARE_SECOND';
0044     const DECIGAL                      = 'DECIGAL';
0045     const DECIMETER_PER_SQUARE_SECOND  = 'DECIMETER_PER_SQUARE_SECOND';
0046     const DEKAMETER_PER_SQUARE_SECOND  = 'DEKAMETER_PER_SQUARE_SECOND';
0047     const FOOT_PER_SQUARE_SECOND       = 'FOOT_PER_SQUARE_SECOND';
0048     const G                            = 'G';
0049     const GAL                          = 'GAL';
0050     const GALILEO                      = 'GALILEO';
0051     const GRAV                         = 'GRAV';
0052     const HECTOMETER_PER_SQUARE_SECOND = 'HECTOMETER_PER_SQUARE_SECOND';
0053     const INCH_PER_SQUARE_SECOND       = 'INCH_PER_SQUARE_SECOND';
0054     const KILOMETER_PER_HOUR_SECOND    = 'KILOMETER_PER_HOUR_SECOND';
0055     const KILOMETER_PER_SQUARE_SECOND  = 'KILOMETER_PER_SQUARE_SECOND';
0056     const METER_PER_SQUARE_SECOND      = 'METER_PER_SQUARE_SECOND';
0057     const MILE_PER_HOUR_MINUTE         = 'MILE_PER_HOUR_MINUTE';
0058     const MILE_PER_HOUR_SECOND         = 'MILE_PER_HOUR_SECOND';
0059     const MILE_PER_SQUARE_SECOND       = 'MILE_PER_SQUARE_SECOND';
0060     const MILLIGAL                     = 'MILLIGAL';
0061     const MILLIMETER_PER_SQUARE_SECOND = 'MILLIMETER_PER_SQUARE_SECOND';
0062 
0063     /**
0064      * Calculations for all acceleration units
0065      *
0066      * @var array
0067      */
0068     protected $_units = array(
0069         'CENTIGAL'                     => array('0.0001',   'cgal'),
0070         'CENTIMETER_PER_SQUARE_SECOND' => array('0.01',     'cm/s²'),
0071         'DECIGAL'                      => array('0.001',    'dgal'),
0072         'DECIMETER_PER_SQUARE_SECOND'  => array('0.1',      'dm/s²'),
0073         'DEKAMETER_PER_SQUARE_SECOND'  => array('10',       'dam/s²'),
0074         'FOOT_PER_SQUARE_SECOND'       => array('0.3048',   'ft/s²'),
0075         'G'                            => array('9.80665',  'g'),
0076         'GAL'                          => array('0.01',     'gal'),
0077         'GALILEO'                      => array('0.01',     'gal'),
0078         'GRAV'                         => array('9.80665',  'g'),
0079         'HECTOMETER_PER_SQUARE_SECOND' => array('100',      'h/s²'),
0080         'INCH_PER_SQUARE_SECOND'       => array('0.0254',   'in/s²'),
0081         'KILOMETER_PER_HOUR_SECOND'    => array(array('' => '5','/' => '18'), 'km/h²'),
0082         'KILOMETER_PER_SQUARE_SECOND'  => array('1000',     'km/s²'),
0083         'METER_PER_SQUARE_SECOND'      => array('1',        'm/s²'),
0084         'MILE_PER_HOUR_MINUTE'         => array(array('' => '22', '/' => '15', '*' => '0.3048', '/' => '60'), 'mph/m'),
0085         'MILE_PER_HOUR_SECOND'         => array(array('' => '22', '/' => '15', '*' => '0.3048'), 'mph/s'),
0086         'MILE_PER_SQUARE_SECOND'       => array('1609.344', 'mi/s²'),
0087         'MILLIGAL'                     => array('0.00001',  'mgal'),
0088         'MILLIMETER_PER_SQUARE_SECOND' => array('0.001',    'mm/s²'),
0089         'STANDARD'                     => 'METER_PER_SQUARE_SECOND'
0090     );
0091 }