mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-11 17:58:41 +00:00
69 lines
1.3 KiB
PHP
69 lines
1.3 KiB
PHP
<?php
|
|
/**
|
|
* Orange Management
|
|
*
|
|
* PHP Version 7.0
|
|
*
|
|
* @category TBD
|
|
* @package TBD
|
|
* @author OMS Development Team <dev@oms.com>
|
|
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
|
* @copyright 2013 Dennis Eichhorn
|
|
* @license OMS License 1.0
|
|
* @version 1.0.0
|
|
* @link http://orange-management.com
|
|
*/
|
|
namespace phpOMS\Math\Algebra;
|
|
|
|
class Rectangle
|
|
{
|
|
|
|
/**
|
|
* Area
|
|
*
|
|
* @param float $a Edge
|
|
* @param float $b Edge
|
|
*
|
|
* @return float
|
|
*
|
|
* @since 1.0.0
|
|
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
|
*/
|
|
public static function getArea(\float $a, \float $b)
|
|
{
|
|
return $a * $b;
|
|
}
|
|
|
|
/**
|
|
* Perimeter
|
|
*
|
|
* @param float $a Edge
|
|
* @param float $b Edge
|
|
*
|
|
* @return float
|
|
*
|
|
* @since 1.0.0
|
|
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
|
*/
|
|
public static function getPerimeter(\float $a, \float $b)
|
|
{
|
|
return 2 * ($a + $b);
|
|
}
|
|
|
|
/**
|
|
* Diagonal
|
|
*
|
|
* @param float $a Edge
|
|
* @param float $b Edge
|
|
*
|
|
* @return float
|
|
*
|
|
* @since 1.0.0
|
|
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
|
*/
|
|
public static function getDiagonal(\float $a, \float $b)
|
|
{
|
|
return sqrt($a * $a + $b * $b);
|
|
}
|
|
}
|