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-2009 Zend Technologies USA Inc. (http://www.zend.com)
18 * @license http://framework.zend.com/license/new-bsd New BSD License
19 * @version $Id: Temperature.php 16220 2009-06-21 19:49:21Z thomas $
23 * Implement needed classes
25 require_once 'Zend/Measure/Abstract.php';
26 require_once 'Zend/Locale.php';
29 * Class for handling temperature conversions
32 * @package Zend_Measure
33 * @subpackage Zend_Measure_Temperature
34 * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
35 * @license http://framework.zend.com/license/new-bsd New BSD License
37 class Zend_Measure_Temperature
extends Zend_Measure_Abstract
39 const STANDARD
= 'KELVIN';
41 const CELSIUS
= 'CELSIUS';
42 const FAHRENHEIT
= 'FAHRENHEIT';
43 const RANKINE
= 'RANKINE';
44 const REAUMUR
= 'REAUMUR';
45 const KELVIN
= 'KELVIN';
48 * Calculations for all temperature units
52 protected $_units = array(
53 'CELSIUS' => array(array('' => '1', '+' => '273.15'),'°C'),
54 'FAHRENHEIT' => array(array('' => '1', '-' => '32', '/' => '1.8', '+' => '273.15'),'°F'),
55 'RANKINE' => array(array('' => '1', '/' => '1.8'),'°R'),
56 'REAUMUR' => array(array('' => '1', '*' => '1.25', '+' => '273.15'),'°r'),
57 'KELVIN' => array(1,'°K'),
58 'STANDARD' => 'KELVIN'