Example #1
0
 public function crossProduct(Vector $mult)
 {
     $cx = $this->get_y() * $mult->get_z() - $this->get_z() * $mult->get_y();
     $cy = $this->get_z() * $mult->get_x() - $this->get_x() * $mult->get_z();
     $cz = $this->get_x() * $mult->get_y() - $this->get_y() * $mult->get_x();
     $dest = new Vertex(array('x' => $cx, 'y' => $cy, 'z' => $cz));
     $prod = new Vector(array('dest' => $dest));
     return $prod;
 }
Example #2
0
 private function _translate(Vector $v)
 {
     $this->_matrix['x']['w'] += $v->get_x();
     $this->_matrix['y']['w'] += $v->get_y();
     $this->_matrix['z']['w'] += $v->get_z();
 }