File indexing completed on 2024-12-22 05:36:51

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 angle conversions
0030  *
0031  * @category   Zend
0032  * @package    Zend_Measure
0033  * @subpackage Zend_Measure_Angle
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_Angle extends Zend_Measure_Abstract
0038 {
0039     const STANDARD = 'RADIAN';
0040 
0041     const RADIAN      = 'RADIAN';
0042     const MIL         = 'MIL';
0043     const GRAD        = 'GRAD';
0044     const DEGREE      = 'DEGREE';
0045     const MINUTE      = 'MINUTE';
0046     const SECOND      = 'SECOND';
0047     const POINT       = 'POINT';
0048     const CIRCLE_16   = 'CIRCLE_16';
0049     const CIRCLE_10   = 'CIRCLE_10';
0050     const CIRCLE_8    = 'CIRCLE_8';
0051     const CIRCLE_6    = 'CIRCLE_6';
0052     const CIRCLE_4    = 'CIRCLE_4';
0053     const CIRCLE_2    = 'CIRCLE_2';
0054     const FULL_CIRCLE = 'FULL_CIRCLE';
0055 
0056     /**
0057      * Calculations for all angle units
0058      *
0059      * @var array
0060      */
0061     protected $_units = array(
0062         'RADIAN'      => array('1','rad'),
0063         'MIL'         => array(array('' => M_PI,'/' => '3200'),   'mil'),
0064         'GRAD'        => array(array('' => M_PI,'/' => '200'),    'gr'),
0065         'DEGREE'      => array(array('' => M_PI,'/' => '180'),    '°'),
0066         'MINUTE'      => array(array('' => M_PI,'/' => '10800'),  "'"),
0067         'SECOND'      => array(array('' => M_PI,'/' => '648000'), '"'),
0068         'POINT'       => array(array('' => M_PI,'/' => '16'),     'pt'),
0069         'CIRCLE_16'   => array(array('' => M_PI,'/' => '8'),      'per 16 circle'),
0070         'CIRCLE_10'   => array(array('' => M_PI,'/' => '5'),      'per 10 circle'),
0071         'CIRCLE_8'    => array(array('' => M_PI,'/' => '4'),      'per 8 circle'),
0072         'CIRCLE_6'    => array(array('' => M_PI,'/' => '3'),      'per 6 circle'),
0073         'CIRCLE_4'    => array(array('' => M_PI,'/' => '2'),      'per 4 circle'),
0074         'CIRCLE_2'    => array(M_PI,                            'per 2 circle'),
0075         'FULL_CIRCLE' => array(array('' => M_PI,'*' => '2'),      'cir'),
0076         'STANDARD'    => 'RADIAN'
0077     );
0078 }