Ejemplo n.º 1
0
 /**
  * Verify that vector() returns the same vector the point was constructed
  * with.
  *
  * @test
  * @covers ::__construct
  * @covers ::vector
  */
 public function vector()
 {
     $vector = new Vector([2, -1, -5]);
     $point = new Point($vector);
     $this->assertSame($vector, $point->vector());
 }
Ejemplo n.º 2
0
 /**
  * Check whether the given point belongs to the same geometric space as this
  * point.
  *
  * @api
  * @param self $b The point to check.
  * @return bool True if the points are in the same geometric space and false otherwise.
  */
 public function isSameSpace(self $b)
 {
     return $this->vector()->isSameVectorSpace($b->vector());
 }