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.
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
23 * Implement needed classes
25 require_once 'Zend/Measure/Abstract.php';
26 require_once 'Zend/Locale.php';
29 * Class for handling angle conversions
32 * @package Zend_Measure
33 * @subpackage Zend_Measure_Angle
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
37 class Zend_Measure_Angle
extends Zend_Measure_Abstract
39 const STANDARD
= 'RADIAN';
41 const RADIAN
= 'RADIAN';
44 const DEGREE
= 'DEGREE';
45 const MINUTE
= 'MINUTE';
46 const SECOND
= 'SECOND';
47 const POINT
= 'POINT';
48 const CIRCLE_16
= 'CIRCLE_16';
49 const CIRCLE_10
= 'CIRCLE_10';
50 const CIRCLE_8
= 'CIRCLE_8';
51 const CIRCLE_6
= 'CIRCLE_6';
52 const CIRCLE_4
= 'CIRCLE_4';
53 const CIRCLE_2
= 'CIRCLE_2';
54 const FULL_CIRCLE
= 'FULL_CIRCLE';
57 * Calculations for all angle units
61 protected $_units = array(
62 'RADIAN' => array('1','rad'),
63 'MIL' => array(array('' => M_PI
,'/' => '3200'), 'mil'),
64 'GRAD' => array(array('' => M_PI
,'/' => '200'), 'gr'),
65 'DEGREE' => array(array('' => M_PI
,'/' => '180'), '°'),
66 'MINUTE' => array(array('' => M_PI
,'/' => '10800'), "'"),
67 'SECOND' => array(array('' => M_PI
,'/' => '648000'), '"'),
68 'POINT' => array(array('' => M_PI
,'/' => '16'), 'pt'),
69 'CIRCLE_16' => array(array('' => M_PI
,'/' => '8'), 'per 16 circle'),
70 'CIRCLE_10' => array(array('' => M_PI
,'/' => '5'), 'per 10 circle'),
71 'CIRCLE_8' => array(array('' => M_PI
,'/' => '4'), 'per 8 circle'),
72 'CIRCLE_6' => array(array('' => M_PI
,'/' => '3'), 'per 6 circle'),
73 'CIRCLE_4' => array(array('' => M_PI
,'/' => '2'), 'per 4 circle'),
74 'CIRCLE_2' => array(M_PI
, 'per 2 circle'),
75 'FULL_CIRCLE' => array(array('' => M_PI
,'*' => '2'), 'cir'),
76 'STANDARD' => 'RADIAN'