Temperature.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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-2015 Zend Technologies USA Inc. (http://www.zend.com)
  18. * @license http://framework.zend.com/license/new-bsd New BSD License
  19. * @version $Id$
  20. */
  21. /**
  22. * Implement needed classes
  23. */
  24. #require_once 'Zend/Measure/Abstract.php';
  25. #require_once 'Zend/Locale.php';
  26. /**
  27. * Class for handling temperature conversions
  28. *
  29. * @category Zend
  30. * @package Zend_Measure
  31. * @subpackage Zend_Measure_Temperature
  32. * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  33. * @license http://framework.zend.com/license/new-bsd New BSD License
  34. */
  35. class Zend_Measure_Temperature extends Zend_Measure_Abstract
  36. {
  37. const STANDARD = 'KELVIN';
  38. const CELSIUS = 'CELSIUS';
  39. const FAHRENHEIT = 'FAHRENHEIT';
  40. const RANKINE = 'RANKINE';
  41. const REAUMUR = 'REAUMUR';
  42. const KELVIN = 'KELVIN';
  43. /**
  44. * Calculations for all temperature units
  45. *
  46. * @var array
  47. */
  48. protected $_units = array(
  49. 'CELSIUS' => array(array('' => '1', '+' => '273.15'),'°C'),
  50. 'FAHRENHEIT' => array(array('' => '1', '-' => '32', '/' => '1.8', '+' => '273.15'),'°F'),
  51. 'RANKINE' => array(array('' => '1', '/' => '1.8'),'°R'),
  52. 'REAUMUR' => array(array('' => '1', '*' => '1.25', '+' => '273.15'),'°r'),
  53. 'KELVIN' => array(1,'°K'),
  54. 'STANDARD' => 'KELVIN'
  55. );
  56. }