コード例 #1
0
 public function testNaiveDivide()
 {
     $unit = new UnitComposition();
     $thrust = new Force(1000, $unit);
     $mass = new Mass(1000, $unit);
     /** @var Acceleration $acceleration */
     $acceleration = $unit->naiveDivide($thrust, $mass);
     $this->assertInstanceOf('Samsara\\PHPhysics\\Units\\Acceleration', $acceleration);
     $this->assertEquals('1', $acceleration->getValue());
 }
コード例 #2
0
ファイル: Quantity.php プロジェクト: vuchl/PHPhysics
 public function divideBy(Quantity $quantity, $precision = 2)
 {
     return $this->unitCompClass->naiveDivide($this, $quantity, $precision);
 }