def refmat(p, q):
 p.normalize()
 q.normalize()
 if ((p - q).norm() < 1e-05):
  return numpy.identity(3)
 pq = (p - q)
 pq.normalize()
 b = pq.get_array()
 b.shape = (3, 1)
 i = numpy.identity(3)
 ref = (i - (2 * numpy.dot(b, numpy.transpose(b))))
 return ref

def refmat ( p , q ) : p . normalize ( ) q . normalize ( ) if ( ( p - q ) . norm ( ) < 1e-05 ) : return numpy . identity ( 3 ) pq = ( p - q ) pq . normalize ( ) b = pq . get_array ( ) b . shape = ( 3 , 1 ) i = numpy . identity ( 3 ) ref = ( i - ( 2 * numpy . dot ( b , numpy . transpose ( b ) ) ) ) return ref
return a matrix that mirrors p onto q .