mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-11 09:48:40 +00:00
70 lines
1.2 KiB
PHP
70 lines
1.2 KiB
PHP
<?php
|
|
/**
|
|
* Orange Management
|
|
*
|
|
* PHP Version 7.2
|
|
*
|
|
* @package TBD
|
|
* @copyright Dennis Eichhorn
|
|
* @license OMS License 1.0
|
|
* @version 1.0.0
|
|
* @link http://website.orange-management.de
|
|
*/
|
|
declare(strict_types=1);
|
|
|
|
namespace phpOMS\Math\Geometry\Shape\D3;
|
|
|
|
/**
|
|
* Tetraedron shape.
|
|
*
|
|
* @package Framework
|
|
* @license OMS License 1.0
|
|
* @link http://website.orange-management.de
|
|
* @since 1.0.0
|
|
*/
|
|
final class Tetrahedron implements D3ShapeInterface
|
|
{
|
|
|
|
/**
|
|
* Volume
|
|
*
|
|
* @param float $a Edge
|
|
*
|
|
* @return float
|
|
*
|
|
* @since 1.0.0
|
|
*/
|
|
public static function getVolume(float $a) : float
|
|
{
|
|
return $a ** 3 / (6 * \sqrt(2));
|
|
}
|
|
|
|
/**
|
|
* Surface area
|
|
*
|
|
* @param float $a Edge
|
|
*
|
|
* @return float
|
|
*
|
|
* @since 1.0.0
|
|
*/
|
|
public static function getSurface(float $a) : float
|
|
{
|
|
return \sqrt(3) * $a ** 2;
|
|
}
|
|
|
|
/**
|
|
* Lateral surface area
|
|
*
|
|
* @param float $a Edge
|
|
*
|
|
* @return float
|
|
*
|
|
* @since 1.0.0
|
|
*/
|
|
public static function getFaceArea(float $a) : float
|
|
{
|
|
return \sqrt(3) / 4 * $a ** 2;
|
|
}
|
|
}
|