web/lib/Zend/Measure/Acceleration.php
changeset 64 162c1de6545a
parent 19 1c2f13fd785c
child 68 ecaf28ffe26e
equal deleted inserted replaced
63:5b37998e522e 64:162c1de6545a
       
     1 <?php
       
     2 /**
       
     3  * Zend Framework
       
     4  *
       
     5  * LICENSE
       
     6  *
       
     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.
       
    14  *
       
    15  * @category  Zend
       
    16  * @package   Zend_Measure
       
    17  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
       
    18  * @license   http://framework.zend.com/license/new-bsd     New BSD License
       
    19  * @version   $Id: Acceleration.php 20096 2010-01-06 02:05:09Z bkarwin $
       
    20  */
       
    21 
       
    22 
       
    23 /**
       
    24  * Implement needed classes
       
    25  */
       
    26 require_once 'Zend/Measure/Abstract.php';
       
    27 require_once 'Zend/Locale.php';
       
    28 
       
    29 /**
       
    30  * Class for handling acceleration conversions
       
    31  *
       
    32  * @category   Zend
       
    33  * @package    Zend_Measure
       
    34  * @subpackage Zend_Measure_Acceleration
       
    35  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
       
    36  * @license    http://framework.zend.com/license/new-bsd     New BSD License
       
    37  */
       
    38 class Zend_Measure_Acceleration extends Zend_Measure_Abstract
       
    39 {
       
    40     const STANDARD = 'METER_PER_SQUARE_SECOND';
       
    41 
       
    42     const CENTIGAL                     = 'CENTIGAL';
       
    43     const CENTIMETER_PER_SQUARE_SECOND = 'CENTIMETER_PER_SQUARE_SECOND';
       
    44     const DECIGAL                      = 'DECIGAL';
       
    45     const DECIMETER_PER_SQUARE_SECOND  = 'DECIMETER_PER_SQUARE_SECOND';
       
    46     const DEKAMETER_PER_SQUARE_SECOND  = 'DEKAMETER_PER_SQUARE_SECOND';
       
    47     const FOOT_PER_SQUARE_SECOND       = 'FOOT_PER_SQUARE_SECOND';
       
    48     const G                            = 'G';
       
    49     const GAL                          = 'GAL';
       
    50     const GALILEO                      = 'GALILEO';
       
    51     const GRAV                         = 'GRAV';
       
    52     const HECTOMETER_PER_SQUARE_SECOND = 'HECTOMETER_PER_SQUARE_SECOND';
       
    53     const INCH_PER_SQUARE_SECOND       = 'INCH_PER_SQUARE_SECOND';
       
    54     const KILOMETER_PER_HOUR_SECOND    = 'KILOMETER_PER_HOUR_SECOND';
       
    55     const KILOMETER_PER_SQUARE_SECOND  = 'KILOMETER_PER_SQUARE_SECOND';
       
    56     const METER_PER_SQUARE_SECOND      = 'METER_PER_SQUARE_SECOND';
       
    57     const MILE_PER_HOUR_MINUTE         = 'MILE_PER_HOUR_MINUTE';
       
    58     const MILE_PER_HOUR_SECOND         = 'MILE_PER_HOUR_SECOND';
       
    59     const MILE_PER_SQUARE_SECOND       = 'MILE_PER_SQUARE_SECOND';
       
    60     const MILLIGAL                     = 'MILLIGAL';
       
    61     const MILLIMETER_PER_SQUARE_SECOND = 'MILLIMETER_PER_SQUARE_SECOND';
       
    62 
       
    63     /**
       
    64      * Calculations for all acceleration units
       
    65      *
       
    66      * @var array
       
    67      */
       
    68     protected $_units = array(
       
    69         'CENTIGAL'                     => array('0.0001',   'cgal'),
       
    70         'CENTIMETER_PER_SQUARE_SECOND' => array('0.01',     'cm/s²'),
       
    71         'DECIGAL'                      => array('0.001',    'dgal'),
       
    72         'DECIMETER_PER_SQUARE_SECOND'  => array('0.1',      'dm/s²'),
       
    73         'DEKAMETER_PER_SQUARE_SECOND'  => array('10',       'dam/s²'),
       
    74         'FOOT_PER_SQUARE_SECOND'       => array('0.3048',   'ft/s²'),
       
    75         'G'                            => array('9.80665',  'g'),
       
    76         'GAL'                          => array('0.01',     'gal'),
       
    77         'GALILEO'                      => array('0.01',     'gal'),
       
    78         'GRAV'                         => array('9.80665',  'g'),
       
    79         'HECTOMETER_PER_SQUARE_SECOND' => array('100',      'h/s²'),
       
    80         'INCH_PER_SQUARE_SECOND'       => array('0.0254',   'in/s²'),
       
    81         'KILOMETER_PER_HOUR_SECOND'    => array(array('' => '5','/' => '18'), 'km/h²'),
       
    82         'KILOMETER_PER_SQUARE_SECOND'  => array('1000',     'km/s²'),
       
    83         'METER_PER_SQUARE_SECOND'      => array('1',        'm/s²'),
       
    84         'MILE_PER_HOUR_MINUTE'         => array(array('' => '22', '/' => '15', '*' => '0.3048', '/' => '60'), 'mph/m'),
       
    85         'MILE_PER_HOUR_SECOND'         => array(array('' => '22', '/' => '15', '*' => '0.3048'), 'mph/s'),
       
    86         'MILE_PER_SQUARE_SECOND'       => array('1609.344', 'mi/s²'),
       
    87         'MILLIGAL'                     => array('0.00001',  'mgal'),
       
    88         'MILLIMETER_PER_SQUARE_SECOND' => array('0.001',    'mm/s²'),
       
    89         'STANDARD'                     => 'METER_PER_SQUARE_SECOND'
       
    90     );
       
    91 }