mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-11 17:58:41 +00:00
80 lines
1.6 KiB
PHP
80 lines
1.6 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;
|
|
|
|
/**
|
|
* Cylinder shape.
|
|
*
|
|
* @category Framework
|
|
* @package phpOMS\DataStorage\Database
|
|
* @author OMS Development Team <dev@oms.com>
|
|
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
|
* @license OMS License 1.0
|
|
* @link http://orange-management.com
|
|
* @since 1.0.0
|
|
*/
|
|
class Cylinder
|
|
{
|
|
|
|
/**
|
|
* Volume
|
|
*
|
|
* @param float $r Radius
|
|
* @param float $h Height
|
|
*
|
|
* @return float
|
|
*
|
|
* @since 1.0.0
|
|
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
|
*/
|
|
public static function getVolume(float $r, float $h)
|
|
{
|
|
return pi() * $r ** 2 * $h;
|
|
}
|
|
|
|
/**
|
|
* Surface area
|
|
*
|
|
* @param float $r Radius
|
|
* @param float $h Height
|
|
*
|
|
* @return float
|
|
*
|
|
* @since 1.0.0
|
|
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
|
*/
|
|
public static function getSurface(float $r, float $h)
|
|
{
|
|
return 2 * pi() * ($r * $h + $r ** 2);
|
|
}
|
|
|
|
/**
|
|
* Lateral surface area
|
|
*
|
|
* @param float $r Radius
|
|
* @param float $h Height
|
|
*
|
|
* @return float
|
|
*
|
|
* @since 1.0.0
|
|
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
|
*/
|
|
public static function getLateralSurface(float $r, float $h)
|
|
{
|
|
return 2 * pi() * $r * $h;
|
|
}
|
|
}
|