Esempio n. 1
0
 public function testMatrixMultiplicationInvalidDimensions2()
 {
     $a = new ezcGraphMatrix(3, 2, array(array(6, -1), array(3, 2), array(0, -3)));
     $b = new ezcGraphMatrix(3, 3, array(array(1, 2, 3), array(4, 5, 6)));
     try {
         $a->multiply($b);
     } catch (ezcGraphMatrixInvalidDimensionsException $e) {
         return true;
     }
     $this->fail('Expected ezcGraphMatrixInvalidDimensionsException.');
 }
Esempio n. 2
0
 /**
  * Transform a coordinate with the current transformation matrix.
  * 
  * @param ezcGraphCoordinate $coordinate 
  * @return ezcGraphCoordinate
  */
 public function transformCoordinate(ezcGraphCoordinate $coordinate)
 {
     $vector = new ezcGraphMatrix(3, 1, array(array($coordinate->x), array($coordinate->y), array(1)));
     $vector = parent::multiply($vector);
     return new ezcGraphCoordinate($vector->get(0, 0), $vector->get(1, 0));
 }