web/Zend/Measure/Force.php
changeset 0 4eba9c11703f
equal deleted inserted replaced
-1:000000000000 0:4eba9c11703f
       
     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: Force.php 20096 2010-01-06 02:05:09Z bkarwin $
       
    20  */
       
    21 
       
    22 /**
       
    23  * Implement needed classes
       
    24  */
       
    25 require_once 'Zend/Measure/Abstract.php';
       
    26 require_once 'Zend/Locale.php';
       
    27 
       
    28 /**
       
    29  * Class for handling force conversions
       
    30  *
       
    31  * @category   Zend
       
    32  * @package    Zend_Measure
       
    33  * @subpackage Zend_Measure_Force
       
    34  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
       
    35  * @license    http://framework.zend.com/license/new-bsd     New BSD License
       
    36  */
       
    37 class Zend_Measure_Force extends Zend_Measure_Abstract
       
    38 {
       
    39     const STANDARD = 'NEWTON';
       
    40 
       
    41     const ATTONEWTON      = 'ATTONEWTON';
       
    42     const CENTINEWTON     = 'CENTINEWTON';
       
    43     const DECIGRAM_FORCE  = 'DECIGRAM_FORCE';
       
    44     const DECINEWTON      = 'DECINEWTON';
       
    45     const DEKAGRAM_FORCE  = 'DEKAGRAM_FORCE';
       
    46     const DEKANEWTON      = 'DEKANEWTON';
       
    47     const DYNE            = 'DYNE';
       
    48     const EXANEWTON       = 'EXANEWTON';
       
    49     const FEMTONEWTON     = 'FEMTONEWTON';
       
    50     const GIGANEWTON      = 'GIGANEWTON';
       
    51     const GRAM_FORCE      = 'GRAM_FORCE';
       
    52     const HECTONEWTON     = 'HECTONEWTON';
       
    53     const JOULE_PER_METER = 'JOULE_PER_METER';
       
    54     const KILOGRAM_FORCE  = 'KILOGRAM_FORCE';
       
    55     const KILONEWTON      = 'KILONEWTON';
       
    56     const KILOPOND        = 'KILOPOND';
       
    57     const KIP             = 'KIP';
       
    58     const MEGANEWTON      = 'MEGANEWTON';
       
    59     const MEGAPOND        = 'MEGAPOND';
       
    60     const MICRONEWTON     = 'MICRONEWTON';
       
    61     const MILLINEWTON     = 'MILLINEWTON';
       
    62     const NANONEWTON      = 'NANONEWTON';
       
    63     const NEWTON          = 'NEWTON';
       
    64     const OUNCE_FORCE     = 'OUNCE_FORCE';
       
    65     const PETANEWTON      = 'PETANEWTON';
       
    66     const PICONEWTON      = 'PICONEWTON';
       
    67     const POND            = 'POND';
       
    68     const POUND_FORCE     = 'POUND_FORCE';
       
    69     const POUNDAL         = 'POUNDAL';
       
    70     const STHENE          = 'STHENE';
       
    71     const TERANEWTON      = 'TERANEWTON';
       
    72     const TON_FORCE_LONG  = 'TON_FORCE_LONG';
       
    73     const TON_FORCE       = 'TON_FORCE';
       
    74     const TON_FORCE_SHORT = 'TON_FORCE_SHORT';
       
    75     const YOCTONEWTON     = 'YOCTONEWTON';
       
    76     const YOTTANEWTON     = 'YOTTANEWTON';
       
    77     const ZEPTONEWTON     = 'ZEPTONEWTON';
       
    78     const ZETTANEWTON     = 'ZETTANEWTON';
       
    79 
       
    80     /**
       
    81      * Calculations for all force units
       
    82      *
       
    83      * @var array
       
    84      */
       
    85     protected $_units = array(
       
    86         'ATTONEWTON'      => array('1.0e-18',     'aN'),
       
    87         'CENTINEWTON'     => array('0.01',        'cN'),
       
    88         'DECIGRAM_FORCE'  => array('0.000980665', 'dgf'),
       
    89         'DECINEWTON'      => array('0.1',         'dN'),
       
    90         'DEKAGRAM_FORCE'  => array('0.0980665',   'dagf'),
       
    91         'DEKANEWTON'      => array('10',          'daN'),
       
    92         'DYNE'            => array('0.00001',     'dyn'),
       
    93         'EXANEWTON'       => array('1.0e+18',     'EN'),
       
    94         'FEMTONEWTON'     => array('1.0e-15',     'fN'),
       
    95         'GIGANEWTON'      => array('1.0e+9',      'GN'),
       
    96         'GRAM_FORCE'      => array('0.00980665',  'gf'),
       
    97         'HECTONEWTON'     => array('100',         'hN'),
       
    98         'JOULE_PER_METER' => array('1',           'J/m'),
       
    99         'KILOGRAM_FORCE'  => array('9.80665',     'kgf'),
       
   100         'KILONEWTON'      => array('1000',        'kN'),
       
   101         'KILOPOND'        => array('9.80665',     'kp'),
       
   102         'KIP'             => array('4448.2216',   'kip'),
       
   103         'MEGANEWTON'      => array('1000000',     'Mp'),
       
   104         'MEGAPOND'        => array('9806.65',     'MN'),
       
   105         'MICRONEWTON'     => array('0.000001',    'µN'),
       
   106         'MILLINEWTON'     => array('0.001',       'mN'),
       
   107         'NANONEWTON'      => array('0.000000001', 'nN'),
       
   108         'NEWTON'          => array('1',           'N'),
       
   109         'OUNCE_FORCE'     => array('0.27801385',  'ozf'),
       
   110         'PETANEWTON'      => array('1.0e+15',     'PN'),
       
   111         'PICONEWTON'      => array('1.0e-12',     'pN'),
       
   112         'POND'            => array('0.00980665',  'pond'),
       
   113         'POUND_FORCE'     => array('4.4482216',   'lbf'),
       
   114         'POUNDAL'         => array('0.13825495',  'pdl'),
       
   115         'STHENE'          => array('1000',        'sn'),
       
   116         'TERANEWTON'      => array('1.0e+12',     'TN'),
       
   117         'TON_FORCE_LONG'  => array('9964.016384', 'tnf'),
       
   118         'TON_FORCE'       => array('9806.65',     'tnf'),
       
   119         'TON_FORCE_SHORT' => array('8896.4432',   'tnf'),
       
   120         'YOCTONEWTON'     => array('1.0e-24',     'yN'),
       
   121         'YOTTANEWTON'     => array('1.0e+24',     'YN'),
       
   122         'ZEPTONEWTON'     => array('1.0e-21',     'zN'),
       
   123         'ZETTANEWTON'     => array('1.0e+21',     'ZN'),
       
   124         'STANDARD'        => 'NEWTON'
       
   125     );
       
   126 }