* @author Dennis Eichhorn * @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 */ 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 */ 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 */ 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); } }