mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-04-02 20:08:41 +00:00
Renaming shapes and implementing them
This commit is contained in:
parent
392b732969
commit
357e672ca0
54
Math/Shape/D3/Cuboid.php
Normal file
54
Math/Shape/D3/Cuboid.php
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
<?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 Cuboid
|
||||
{
|
||||
|
||||
/**
|
||||
* Volume
|
||||
*
|
||||
* @param float $a Edge
|
||||
* @param float $b Edge
|
||||
* @param float $h Height
|
||||
*
|
||||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function getVolume(\float $a, \float $b, \float $h)
|
||||
{
|
||||
return $a * $b * $h;
|
||||
}
|
||||
|
||||
/**
|
||||
* Surface area
|
||||
*
|
||||
* @param float $a Edge
|
||||
* @param float $b Edge
|
||||
* @param float $h Height
|
||||
*
|
||||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function getSurface(\float $a, \float $b, \float $h)
|
||||
{
|
||||
return 2 * ($a * $b + $a * $h + $b * $h);
|
||||
}
|
||||
}
|
||||
71
Math/Shape/D3/RectangularPyramid.php
Normal file
71
Math/Shape/D3/RectangularPyramid.php
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
<?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 RectangularPyramid
|
||||
{
|
||||
|
||||
/**
|
||||
* Volume
|
||||
*
|
||||
* @param float $a Edge
|
||||
* @param float $b Edge
|
||||
* @param float $h Height
|
||||
*
|
||||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function getVolume(\float $a, \float $b, \float $h)
|
||||
{
|
||||
return $a * $b * $h / 3;
|
||||
}
|
||||
|
||||
/**
|
||||
* Surface area
|
||||
*
|
||||
* @param float $a Edge
|
||||
* @param float $b Edge
|
||||
* @param float $h Height
|
||||
*
|
||||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function getSurface(\float $a, \float $b, \float $h)
|
||||
{
|
||||
return $a * $b + $a * sqrt(($b / 2) ** 2 + $h ** 2) + $b * sqrt(($a / 2) ** 2 + $h ** 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* Lateral surface area
|
||||
*
|
||||
* @param float $a Edge
|
||||
* @param float $b Edge
|
||||
* @param float $h Height
|
||||
*
|
||||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function getLateralSurface(\float $a, \float $b, \float $h)
|
||||
{
|
||||
return $a * sqrt(($b / 2) ** 2 + $h ** 2) + $b * sqrt(($a / 2) ** 2 + $h ** 2);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user