mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-13 18:48:40 +00:00
39 lines
925 B
PHP
39 lines
925 B
PHP
<?php
|
|
/**
|
|
* Orange Management
|
|
*
|
|
* PHP Version 7.1
|
|
*
|
|
* @package TBD
|
|
* @copyright Dennis Eichhorn
|
|
* @license OMS License 1.0
|
|
* @version 1.0.0
|
|
* @link http://website.orange-management.de
|
|
*/
|
|
|
|
namespace phpOMS\tests\Math\Geometry\Shape\D3;
|
|
|
|
use phpOMS\Math\Geometry\Shape\D3\Sphere;
|
|
|
|
class SphereTest extends \PHPUnit\Framework\TestCase
|
|
{
|
|
public function testSphere()
|
|
{
|
|
$sphere = new Sphere(3);
|
|
self::assertEquals(113.1, $sphere->getVolume(), '', 0.1);
|
|
self::assertEquals(113.1, $sphere->getSurface(), '', 0.1);
|
|
}
|
|
|
|
public function testGetBy()
|
|
{
|
|
$sphere = Sphere::byRadius(3);
|
|
self::assertEquals(3, $sphere->getRadius(), '', 0.1);
|
|
|
|
$sphere = Sphere::byVolume(4);
|
|
self::assertEquals(4, $sphere->getVolume(), '', 0.1);
|
|
|
|
$sphere = Sphere::bySurface(5);
|
|
self::assertEquals(5, $sphere->getSurface(), '', 0.1);
|
|
}
|
|
}
|