Пример #1
0
 function testInvert()
 {
     $unit = Math_Matrix::makeUnit(4);
     $q = new Math_Matrix($this->data);
     $p = $q->clone();
     $q->invert();
     $p->multiply($q);
     $this->assertEquals($unit->getData(), $p->getData());
 }
Пример #2
0
 /**
  * Returns the identity matrix of the given size. An alias of Math_Matrix::makeUnit()
  *
  * @static
  * @access public
  * @param integer $size number of rows and columns in the generated matrix
  * @return object a Math_Matrix instance
  * @see Math_Matrix::makeUnit()
  */
 function &makeIdentity($size)
 {
     /*{{{*/
     return Math_Matrix::makeUnit($size);
 }
Пример #3
0
 function testMakeUnit()
 {
     $data = array(array(1.0, 0.0, 0.0), array(0.0, 1.0, 0.0), array(0.0, 0.0, 1.0));
     $q = Math_Matrix::makeUnit(3);
     $this->assertEquals($data, $q->getData());
 }